
obj/user/icode.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 07 01 00 00       	call   800138 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:
#include <inc/lib.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	56                   	push   %esi
  80003b:	53                   	push   %ebx
  80003c:	81 ec 1c 02 00 00    	sub    $0x21c,%esp
	int fd, n, r;
	char buf[512+1];

	binaryname = "icode";
  800042:	c7 05 00 30 80 00 e0 	movl   $0x8025e0,0x803000
  800049:	25 80 00 

	cprintf("icode startup\n");
  80004c:	68 e6 25 80 00       	push   $0x8025e6
  800051:	e8 3b 02 00 00       	call   800291 <cprintf>

	cprintf("icode: open /motd\n");
  800056:	c7 04 24 f5 25 80 00 	movl   $0x8025f5,(%esp)
  80005d:	e8 2f 02 00 00       	call   800291 <cprintf>
	if ((fd = open("/motd", O_RDONLY)) < 0)
  800062:	83 c4 08             	add    $0x8,%esp
  800065:	6a 00                	push   $0x0
  800067:	68 08 26 80 00       	push   $0x802608
  80006c:	e8 e9 15 00 00       	call   80165a <open>
  800071:	89 c6                	mov    %eax,%esi
  800073:	83 c4 10             	add    $0x10,%esp
  800076:	85 c0                	test   %eax,%eax
  800078:	78 18                	js     800092 <umain+0x5f>
		panic("icode: open /motd: %e", fd);

	cprintf("icode: read /motd\n");
  80007a:	83 ec 0c             	sub    $0xc,%esp
  80007d:	68 31 26 80 00       	push   $0x802631
  800082:	e8 0a 02 00 00       	call   800291 <cprintf>
	while ((n = read(fd, buf, sizeof buf-1)) > 0)
  800087:	83 c4 10             	add    $0x10,%esp
  80008a:	8d 9d f7 fd ff ff    	lea    -0x209(%ebp),%ebx
  800090:	eb 1f                	jmp    8000b1 <umain+0x7e>
		panic("icode: open /motd: %e", fd);
  800092:	50                   	push   %eax
  800093:	68 0e 26 80 00       	push   $0x80260e
  800098:	6a 0f                	push   $0xf
  80009a:	68 24 26 80 00       	push   $0x802624
  80009f:	e8 06 01 00 00       	call   8001aa <_panic>
		sys_cputs(buf, n);
  8000a4:	83 ec 08             	sub    $0x8,%esp
  8000a7:	50                   	push   %eax
  8000a8:	53                   	push   %ebx
  8000a9:	e8 2e 0b 00 00       	call   800bdc <sys_cputs>
  8000ae:	83 c4 10             	add    $0x10,%esp
	while ((n = read(fd, buf, sizeof buf-1)) > 0)
  8000b1:	83 ec 04             	sub    $0x4,%esp
  8000b4:	68 00 02 00 00       	push   $0x200
  8000b9:	53                   	push   %ebx
  8000ba:	56                   	push   %esi
  8000bb:	e8 05 11 00 00       	call   8011c5 <read>
  8000c0:	83 c4 10             	add    $0x10,%esp
  8000c3:	85 c0                	test   %eax,%eax
  8000c5:	7f dd                	jg     8000a4 <umain+0x71>

	cprintf("icode: close /motd\n");
  8000c7:	83 ec 0c             	sub    $0xc,%esp
  8000ca:	68 44 26 80 00       	push   $0x802644
  8000cf:	e8 bd 01 00 00       	call   800291 <cprintf>
	close(fd);
  8000d4:	89 34 24             	mov    %esi,(%esp)
  8000d7:	e8 9f 0f 00 00       	call   80107b <close>

	cprintf("icode: spawn /init\n");
  8000dc:	c7 04 24 58 26 80 00 	movl   $0x802658,(%esp)
  8000e3:	e8 a9 01 00 00       	call   800291 <cprintf>
	if ((r = spawnl("/init", "init", "initarg1", "initarg2", (char*)0)) < 0)
  8000e8:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8000ef:	68 6c 26 80 00       	push   $0x80266c
  8000f4:	68 75 26 80 00       	push   $0x802675
  8000f9:	68 7f 26 80 00       	push   $0x80267f
  8000fe:	68 7e 26 80 00       	push   $0x80267e
  800103:	e8 59 1b 00 00       	call   801c61 <spawnl>
  800108:	83 c4 20             	add    $0x20,%esp
  80010b:	85 c0                	test   %eax,%eax
  80010d:	78 17                	js     800126 <umain+0xf3>
		panic("icode: spawn /init: %e", r);

	cprintf("icode: exiting\n");
  80010f:	83 ec 0c             	sub    $0xc,%esp
  800112:	68 9b 26 80 00       	push   $0x80269b
  800117:	e8 75 01 00 00       	call   800291 <cprintf>
}
  80011c:	83 c4 10             	add    $0x10,%esp
  80011f:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800122:	5b                   	pop    %ebx
  800123:	5e                   	pop    %esi
  800124:	5d                   	pop    %ebp
  800125:	c3                   	ret    
		panic("icode: spawn /init: %e", r);
  800126:	50                   	push   %eax
  800127:	68 84 26 80 00       	push   $0x802684
  80012c:	6a 1a                	push   $0x1a
  80012e:	68 24 26 80 00       	push   $0x802624
  800133:	e8 72 00 00 00       	call   8001aa <_panic>

00800138 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800138:	f3 0f 1e fb          	endbr32 
  80013c:	55                   	push   %ebp
  80013d:	89 e5                	mov    %esp,%ebp
  80013f:	56                   	push   %esi
  800140:	53                   	push   %ebx
  800141:	8b 5d 08             	mov    0x8(%ebp),%ebx
  800144:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800147:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  80014e:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  800151:	e8 10 0b 00 00       	call   800c66 <sys_getenvid>
  800156:	25 ff 03 00 00       	and    $0x3ff,%eax
  80015b:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80015e:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800163:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800168:	85 db                	test   %ebx,%ebx
  80016a:	7e 07                	jle    800173 <libmain+0x3b>
		binaryname = argv[0];
  80016c:	8b 06                	mov    (%esi),%eax
  80016e:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  800173:	83 ec 08             	sub    $0x8,%esp
  800176:	56                   	push   %esi
  800177:	53                   	push   %ebx
  800178:	e8 b6 fe ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  80017d:	e8 0a 00 00 00       	call   80018c <exit>
}
  800182:	83 c4 10             	add    $0x10,%esp
  800185:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800188:	5b                   	pop    %ebx
  800189:	5e                   	pop    %esi
  80018a:	5d                   	pop    %ebp
  80018b:	c3                   	ret    

0080018c <exit>:

#include <inc/lib.h>

void
exit(void)
{
  80018c:	f3 0f 1e fb          	endbr32 
  800190:	55                   	push   %ebp
  800191:	89 e5                	mov    %esp,%ebp
  800193:	83 ec 08             	sub    $0x8,%esp
	close_all();
  800196:	e8 11 0f 00 00       	call   8010ac <close_all>
	sys_env_destroy(0);
  80019b:	83 ec 0c             	sub    $0xc,%esp
  80019e:	6a 00                	push   $0x0
  8001a0:	e8 7c 0a 00 00       	call   800c21 <sys_env_destroy>
}
  8001a5:	83 c4 10             	add    $0x10,%esp
  8001a8:	c9                   	leave  
  8001a9:	c3                   	ret    

008001aa <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  8001aa:	f3 0f 1e fb          	endbr32 
  8001ae:	55                   	push   %ebp
  8001af:	89 e5                	mov    %esp,%ebp
  8001b1:	56                   	push   %esi
  8001b2:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  8001b3:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  8001b6:	8b 35 00 30 80 00    	mov    0x803000,%esi
  8001bc:	e8 a5 0a 00 00       	call   800c66 <sys_getenvid>
  8001c1:	83 ec 0c             	sub    $0xc,%esp
  8001c4:	ff 75 0c             	pushl  0xc(%ebp)
  8001c7:	ff 75 08             	pushl  0x8(%ebp)
  8001ca:	56                   	push   %esi
  8001cb:	50                   	push   %eax
  8001cc:	68 b8 26 80 00       	push   $0x8026b8
  8001d1:	e8 bb 00 00 00       	call   800291 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  8001d6:	83 c4 18             	add    $0x18,%esp
  8001d9:	53                   	push   %ebx
  8001da:	ff 75 10             	pushl  0x10(%ebp)
  8001dd:	e8 5a 00 00 00       	call   80023c <vcprintf>
	cprintf("\n");
  8001e2:	c7 04 24 7e 2b 80 00 	movl   $0x802b7e,(%esp)
  8001e9:	e8 a3 00 00 00       	call   800291 <cprintf>
  8001ee:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  8001f1:	cc                   	int3   
  8001f2:	eb fd                	jmp    8001f1 <_panic+0x47>

008001f4 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  8001f4:	f3 0f 1e fb          	endbr32 
  8001f8:	55                   	push   %ebp
  8001f9:	89 e5                	mov    %esp,%ebp
  8001fb:	53                   	push   %ebx
  8001fc:	83 ec 04             	sub    $0x4,%esp
  8001ff:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  800202:	8b 13                	mov    (%ebx),%edx
  800204:	8d 42 01             	lea    0x1(%edx),%eax
  800207:	89 03                	mov    %eax,(%ebx)
  800209:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80020c:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  800210:	3d ff 00 00 00       	cmp    $0xff,%eax
  800215:	74 09                	je     800220 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  800217:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  80021b:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80021e:	c9                   	leave  
  80021f:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  800220:	83 ec 08             	sub    $0x8,%esp
  800223:	68 ff 00 00 00       	push   $0xff
  800228:	8d 43 08             	lea    0x8(%ebx),%eax
  80022b:	50                   	push   %eax
  80022c:	e8 ab 09 00 00       	call   800bdc <sys_cputs>
		b->idx = 0;
  800231:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800237:	83 c4 10             	add    $0x10,%esp
  80023a:	eb db                	jmp    800217 <putch+0x23>

0080023c <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  80023c:	f3 0f 1e fb          	endbr32 
  800240:	55                   	push   %ebp
  800241:	89 e5                	mov    %esp,%ebp
  800243:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  800249:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800250:	00 00 00 
	b.cnt = 0;
  800253:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  80025a:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  80025d:	ff 75 0c             	pushl  0xc(%ebp)
  800260:	ff 75 08             	pushl  0x8(%ebp)
  800263:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800269:	50                   	push   %eax
  80026a:	68 f4 01 80 00       	push   $0x8001f4
  80026f:	e8 20 01 00 00       	call   800394 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800274:	83 c4 08             	add    $0x8,%esp
  800277:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80027d:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800283:	50                   	push   %eax
  800284:	e8 53 09 00 00       	call   800bdc <sys_cputs>

	return b.cnt;
}
  800289:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  80028f:	c9                   	leave  
  800290:	c3                   	ret    

00800291 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800291:	f3 0f 1e fb          	endbr32 
  800295:	55                   	push   %ebp
  800296:	89 e5                	mov    %esp,%ebp
  800298:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  80029b:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  80029e:	50                   	push   %eax
  80029f:	ff 75 08             	pushl  0x8(%ebp)
  8002a2:	e8 95 ff ff ff       	call   80023c <vcprintf>
	va_end(ap);

	return cnt;
}
  8002a7:	c9                   	leave  
  8002a8:	c3                   	ret    

008002a9 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  8002a9:	55                   	push   %ebp
  8002aa:	89 e5                	mov    %esp,%ebp
  8002ac:	57                   	push   %edi
  8002ad:	56                   	push   %esi
  8002ae:	53                   	push   %ebx
  8002af:	83 ec 1c             	sub    $0x1c,%esp
  8002b2:	89 c7                	mov    %eax,%edi
  8002b4:	89 d6                	mov    %edx,%esi
  8002b6:	8b 45 08             	mov    0x8(%ebp),%eax
  8002b9:	8b 55 0c             	mov    0xc(%ebp),%edx
  8002bc:	89 d1                	mov    %edx,%ecx
  8002be:	89 c2                	mov    %eax,%edx
  8002c0:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8002c3:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8002c6:	8b 45 10             	mov    0x10(%ebp),%eax
  8002c9:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8002cc:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8002cf:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8002d6:	39 c2                	cmp    %eax,%edx
  8002d8:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8002db:	72 3e                	jb     80031b <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8002dd:	83 ec 0c             	sub    $0xc,%esp
  8002e0:	ff 75 18             	pushl  0x18(%ebp)
  8002e3:	83 eb 01             	sub    $0x1,%ebx
  8002e6:	53                   	push   %ebx
  8002e7:	50                   	push   %eax
  8002e8:	83 ec 08             	sub    $0x8,%esp
  8002eb:	ff 75 e4             	pushl  -0x1c(%ebp)
  8002ee:	ff 75 e0             	pushl  -0x20(%ebp)
  8002f1:	ff 75 dc             	pushl  -0x24(%ebp)
  8002f4:	ff 75 d8             	pushl  -0x28(%ebp)
  8002f7:	e8 74 20 00 00       	call   802370 <__udivdi3>
  8002fc:	83 c4 18             	add    $0x18,%esp
  8002ff:	52                   	push   %edx
  800300:	50                   	push   %eax
  800301:	89 f2                	mov    %esi,%edx
  800303:	89 f8                	mov    %edi,%eax
  800305:	e8 9f ff ff ff       	call   8002a9 <printnum>
  80030a:	83 c4 20             	add    $0x20,%esp
  80030d:	eb 13                	jmp    800322 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  80030f:	83 ec 08             	sub    $0x8,%esp
  800312:	56                   	push   %esi
  800313:	ff 75 18             	pushl  0x18(%ebp)
  800316:	ff d7                	call   *%edi
  800318:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  80031b:	83 eb 01             	sub    $0x1,%ebx
  80031e:	85 db                	test   %ebx,%ebx
  800320:	7f ed                	jg     80030f <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  800322:	83 ec 08             	sub    $0x8,%esp
  800325:	56                   	push   %esi
  800326:	83 ec 04             	sub    $0x4,%esp
  800329:	ff 75 e4             	pushl  -0x1c(%ebp)
  80032c:	ff 75 e0             	pushl  -0x20(%ebp)
  80032f:	ff 75 dc             	pushl  -0x24(%ebp)
  800332:	ff 75 d8             	pushl  -0x28(%ebp)
  800335:	e8 46 21 00 00       	call   802480 <__umoddi3>
  80033a:	83 c4 14             	add    $0x14,%esp
  80033d:	0f be 80 db 26 80 00 	movsbl 0x8026db(%eax),%eax
  800344:	50                   	push   %eax
  800345:	ff d7                	call   *%edi
}
  800347:	83 c4 10             	add    $0x10,%esp
  80034a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80034d:	5b                   	pop    %ebx
  80034e:	5e                   	pop    %esi
  80034f:	5f                   	pop    %edi
  800350:	5d                   	pop    %ebp
  800351:	c3                   	ret    

00800352 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800352:	f3 0f 1e fb          	endbr32 
  800356:	55                   	push   %ebp
  800357:	89 e5                	mov    %esp,%ebp
  800359:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  80035c:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800360:	8b 10                	mov    (%eax),%edx
  800362:	3b 50 04             	cmp    0x4(%eax),%edx
  800365:	73 0a                	jae    800371 <sprintputch+0x1f>
		*b->buf++ = ch;
  800367:	8d 4a 01             	lea    0x1(%edx),%ecx
  80036a:	89 08                	mov    %ecx,(%eax)
  80036c:	8b 45 08             	mov    0x8(%ebp),%eax
  80036f:	88 02                	mov    %al,(%edx)
}
  800371:	5d                   	pop    %ebp
  800372:	c3                   	ret    

00800373 <printfmt>:
{
  800373:	f3 0f 1e fb          	endbr32 
  800377:	55                   	push   %ebp
  800378:	89 e5                	mov    %esp,%ebp
  80037a:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80037d:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800380:	50                   	push   %eax
  800381:	ff 75 10             	pushl  0x10(%ebp)
  800384:	ff 75 0c             	pushl  0xc(%ebp)
  800387:	ff 75 08             	pushl  0x8(%ebp)
  80038a:	e8 05 00 00 00       	call   800394 <vprintfmt>
}
  80038f:	83 c4 10             	add    $0x10,%esp
  800392:	c9                   	leave  
  800393:	c3                   	ret    

00800394 <vprintfmt>:
{
  800394:	f3 0f 1e fb          	endbr32 
  800398:	55                   	push   %ebp
  800399:	89 e5                	mov    %esp,%ebp
  80039b:	57                   	push   %edi
  80039c:	56                   	push   %esi
  80039d:	53                   	push   %ebx
  80039e:	83 ec 3c             	sub    $0x3c,%esp
  8003a1:	8b 75 08             	mov    0x8(%ebp),%esi
  8003a4:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8003a7:	8b 7d 10             	mov    0x10(%ebp),%edi
  8003aa:	e9 5d 03 00 00       	jmp    80070c <vprintfmt+0x378>
		padc = ' ';
  8003af:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  8003b3:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  8003ba:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8003c1:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8003c8:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8003cd:	8d 47 01             	lea    0x1(%edi),%eax
  8003d0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8003d3:	0f b6 17             	movzbl (%edi),%edx
  8003d6:	8d 42 dd             	lea    -0x23(%edx),%eax
  8003d9:	3c 55                	cmp    $0x55,%al
  8003db:	0f 87 ae 03 00 00    	ja     80078f <vprintfmt+0x3fb>
  8003e1:	0f b6 c0             	movzbl %al,%eax
  8003e4:	3e ff 24 85 20 28 80 	notrack jmp *0x802820(,%eax,4)
  8003eb:	00 
  8003ec:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  8003ef:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  8003f3:	eb d8                	jmp    8003cd <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8003f5:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8003f8:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8003fc:	eb cf                	jmp    8003cd <vprintfmt+0x39>
  8003fe:	0f b6 d2             	movzbl %dl,%edx
  800401:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  800404:	b8 00 00 00 00       	mov    $0x0,%eax
  800409:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  80040c:	8d 04 80             	lea    (%eax,%eax,4),%eax
  80040f:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  800413:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  800416:	8d 4a d0             	lea    -0x30(%edx),%ecx
  800419:	83 f9 09             	cmp    $0x9,%ecx
  80041c:	77 55                	ja     800473 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  80041e:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  800421:	eb e9                	jmp    80040c <vprintfmt+0x78>
			precision = va_arg(ap, int);
  800423:	8b 45 14             	mov    0x14(%ebp),%eax
  800426:	8b 00                	mov    (%eax),%eax
  800428:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80042b:	8b 45 14             	mov    0x14(%ebp),%eax
  80042e:	8d 40 04             	lea    0x4(%eax),%eax
  800431:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800434:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800437:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80043b:	79 90                	jns    8003cd <vprintfmt+0x39>
				width = precision, precision = -1;
  80043d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800440:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800443:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  80044a:	eb 81                	jmp    8003cd <vprintfmt+0x39>
  80044c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  80044f:	85 c0                	test   %eax,%eax
  800451:	ba 00 00 00 00       	mov    $0x0,%edx
  800456:	0f 49 d0             	cmovns %eax,%edx
  800459:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  80045c:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80045f:	e9 69 ff ff ff       	jmp    8003cd <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800464:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800467:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  80046e:	e9 5a ff ff ff       	jmp    8003cd <vprintfmt+0x39>
  800473:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800476:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800479:	eb bc                	jmp    800437 <vprintfmt+0xa3>
			lflag++;
  80047b:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80047e:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800481:	e9 47 ff ff ff       	jmp    8003cd <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800486:	8b 45 14             	mov    0x14(%ebp),%eax
  800489:	8d 78 04             	lea    0x4(%eax),%edi
  80048c:	83 ec 08             	sub    $0x8,%esp
  80048f:	53                   	push   %ebx
  800490:	ff 30                	pushl  (%eax)
  800492:	ff d6                	call   *%esi
			break;
  800494:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800497:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  80049a:	e9 6a 02 00 00       	jmp    800709 <vprintfmt+0x375>
			err = va_arg(ap, int);
  80049f:	8b 45 14             	mov    0x14(%ebp),%eax
  8004a2:	8d 78 04             	lea    0x4(%eax),%edi
  8004a5:	8b 00                	mov    (%eax),%eax
  8004a7:	99                   	cltd   
  8004a8:	31 d0                	xor    %edx,%eax
  8004aa:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  8004ac:	83 f8 0f             	cmp    $0xf,%eax
  8004af:	7f 23                	jg     8004d4 <vprintfmt+0x140>
  8004b1:	8b 14 85 80 29 80 00 	mov    0x802980(,%eax,4),%edx
  8004b8:	85 d2                	test   %edx,%edx
  8004ba:	74 18                	je     8004d4 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  8004bc:	52                   	push   %edx
  8004bd:	68 b1 2a 80 00       	push   $0x802ab1
  8004c2:	53                   	push   %ebx
  8004c3:	56                   	push   %esi
  8004c4:	e8 aa fe ff ff       	call   800373 <printfmt>
  8004c9:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8004cc:	89 7d 14             	mov    %edi,0x14(%ebp)
  8004cf:	e9 35 02 00 00       	jmp    800709 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8004d4:	50                   	push   %eax
  8004d5:	68 f3 26 80 00       	push   $0x8026f3
  8004da:	53                   	push   %ebx
  8004db:	56                   	push   %esi
  8004dc:	e8 92 fe ff ff       	call   800373 <printfmt>
  8004e1:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8004e4:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  8004e7:	e9 1d 02 00 00       	jmp    800709 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  8004ec:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ef:	83 c0 04             	add    $0x4,%eax
  8004f2:	89 45 c8             	mov    %eax,-0x38(%ebp)
  8004f5:	8b 45 14             	mov    0x14(%ebp),%eax
  8004f8:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8004fa:	85 d2                	test   %edx,%edx
  8004fc:	b8 ec 26 80 00       	mov    $0x8026ec,%eax
  800501:	0f 45 c2             	cmovne %edx,%eax
  800504:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  800507:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80050b:	7e 06                	jle    800513 <vprintfmt+0x17f>
  80050d:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  800511:	75 0d                	jne    800520 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  800513:	8b 45 cc             	mov    -0x34(%ebp),%eax
  800516:	89 c7                	mov    %eax,%edi
  800518:	03 45 d4             	add    -0x2c(%ebp),%eax
  80051b:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80051e:	eb 55                	jmp    800575 <vprintfmt+0x1e1>
  800520:	83 ec 08             	sub    $0x8,%esp
  800523:	ff 75 d8             	pushl  -0x28(%ebp)
  800526:	ff 75 cc             	pushl  -0x34(%ebp)
  800529:	e8 15 03 00 00       	call   800843 <strnlen>
  80052e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800531:	29 c2                	sub    %eax,%edx
  800533:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800536:	83 c4 10             	add    $0x10,%esp
  800539:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  80053b:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  80053f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  800542:	85 ff                	test   %edi,%edi
  800544:	7e 11                	jle    800557 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800546:	83 ec 08             	sub    $0x8,%esp
  800549:	53                   	push   %ebx
  80054a:	ff 75 d4             	pushl  -0x2c(%ebp)
  80054d:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  80054f:	83 ef 01             	sub    $0x1,%edi
  800552:	83 c4 10             	add    $0x10,%esp
  800555:	eb eb                	jmp    800542 <vprintfmt+0x1ae>
  800557:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  80055a:	85 d2                	test   %edx,%edx
  80055c:	b8 00 00 00 00       	mov    $0x0,%eax
  800561:	0f 49 c2             	cmovns %edx,%eax
  800564:	29 c2                	sub    %eax,%edx
  800566:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800569:	eb a8                	jmp    800513 <vprintfmt+0x17f>
					putch(ch, putdat);
  80056b:	83 ec 08             	sub    $0x8,%esp
  80056e:	53                   	push   %ebx
  80056f:	52                   	push   %edx
  800570:	ff d6                	call   *%esi
  800572:	83 c4 10             	add    $0x10,%esp
  800575:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800578:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80057a:	83 c7 01             	add    $0x1,%edi
  80057d:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800581:	0f be d0             	movsbl %al,%edx
  800584:	85 d2                	test   %edx,%edx
  800586:	74 4b                	je     8005d3 <vprintfmt+0x23f>
  800588:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  80058c:	78 06                	js     800594 <vprintfmt+0x200>
  80058e:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  800592:	78 1e                	js     8005b2 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800594:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800598:	74 d1                	je     80056b <vprintfmt+0x1d7>
  80059a:	0f be c0             	movsbl %al,%eax
  80059d:	83 e8 20             	sub    $0x20,%eax
  8005a0:	83 f8 5e             	cmp    $0x5e,%eax
  8005a3:	76 c6                	jbe    80056b <vprintfmt+0x1d7>
					putch('?', putdat);
  8005a5:	83 ec 08             	sub    $0x8,%esp
  8005a8:	53                   	push   %ebx
  8005a9:	6a 3f                	push   $0x3f
  8005ab:	ff d6                	call   *%esi
  8005ad:	83 c4 10             	add    $0x10,%esp
  8005b0:	eb c3                	jmp    800575 <vprintfmt+0x1e1>
  8005b2:	89 cf                	mov    %ecx,%edi
  8005b4:	eb 0e                	jmp    8005c4 <vprintfmt+0x230>
				putch(' ', putdat);
  8005b6:	83 ec 08             	sub    $0x8,%esp
  8005b9:	53                   	push   %ebx
  8005ba:	6a 20                	push   $0x20
  8005bc:	ff d6                	call   *%esi
			for (; width > 0; width--)
  8005be:	83 ef 01             	sub    $0x1,%edi
  8005c1:	83 c4 10             	add    $0x10,%esp
  8005c4:	85 ff                	test   %edi,%edi
  8005c6:	7f ee                	jg     8005b6 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8005c8:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8005cb:	89 45 14             	mov    %eax,0x14(%ebp)
  8005ce:	e9 36 01 00 00       	jmp    800709 <vprintfmt+0x375>
  8005d3:	89 cf                	mov    %ecx,%edi
  8005d5:	eb ed                	jmp    8005c4 <vprintfmt+0x230>
	if (lflag >= 2)
  8005d7:	83 f9 01             	cmp    $0x1,%ecx
  8005da:	7f 1f                	jg     8005fb <vprintfmt+0x267>
	else if (lflag)
  8005dc:	85 c9                	test   %ecx,%ecx
  8005de:	74 67                	je     800647 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8005e0:	8b 45 14             	mov    0x14(%ebp),%eax
  8005e3:	8b 00                	mov    (%eax),%eax
  8005e5:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005e8:	89 c1                	mov    %eax,%ecx
  8005ea:	c1 f9 1f             	sar    $0x1f,%ecx
  8005ed:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8005f0:	8b 45 14             	mov    0x14(%ebp),%eax
  8005f3:	8d 40 04             	lea    0x4(%eax),%eax
  8005f6:	89 45 14             	mov    %eax,0x14(%ebp)
  8005f9:	eb 17                	jmp    800612 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8005fb:	8b 45 14             	mov    0x14(%ebp),%eax
  8005fe:	8b 50 04             	mov    0x4(%eax),%edx
  800601:	8b 00                	mov    (%eax),%eax
  800603:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800606:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800609:	8b 45 14             	mov    0x14(%ebp),%eax
  80060c:	8d 40 08             	lea    0x8(%eax),%eax
  80060f:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  800612:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800615:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  800618:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  80061d:	85 c9                	test   %ecx,%ecx
  80061f:	0f 89 ca 00 00 00    	jns    8006ef <vprintfmt+0x35b>
				putch('-', putdat);
  800625:	83 ec 08             	sub    $0x8,%esp
  800628:	53                   	push   %ebx
  800629:	6a 2d                	push   $0x2d
  80062b:	ff d6                	call   *%esi
				num = -(long long) num;
  80062d:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800630:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800633:	f7 da                	neg    %edx
  800635:	83 d1 00             	adc    $0x0,%ecx
  800638:	f7 d9                	neg    %ecx
  80063a:	83 c4 10             	add    $0x10,%esp
			base = 10;
  80063d:	b8 0a 00 00 00       	mov    $0xa,%eax
  800642:	e9 a8 00 00 00       	jmp    8006ef <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800647:	8b 45 14             	mov    0x14(%ebp),%eax
  80064a:	8b 00                	mov    (%eax),%eax
  80064c:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80064f:	99                   	cltd   
  800650:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800653:	8b 45 14             	mov    0x14(%ebp),%eax
  800656:	8d 40 04             	lea    0x4(%eax),%eax
  800659:	89 45 14             	mov    %eax,0x14(%ebp)
  80065c:	eb b4                	jmp    800612 <vprintfmt+0x27e>
	if (lflag >= 2)
  80065e:	83 f9 01             	cmp    $0x1,%ecx
  800661:	7f 1b                	jg     80067e <vprintfmt+0x2ea>
	else if (lflag)
  800663:	85 c9                	test   %ecx,%ecx
  800665:	74 2c                	je     800693 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800667:	8b 45 14             	mov    0x14(%ebp),%eax
  80066a:	8b 10                	mov    (%eax),%edx
  80066c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800671:	8d 40 04             	lea    0x4(%eax),%eax
  800674:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800677:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80067c:	eb 71                	jmp    8006ef <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80067e:	8b 45 14             	mov    0x14(%ebp),%eax
  800681:	8b 10                	mov    (%eax),%edx
  800683:	8b 48 04             	mov    0x4(%eax),%ecx
  800686:	8d 40 08             	lea    0x8(%eax),%eax
  800689:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80068c:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800691:	eb 5c                	jmp    8006ef <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800693:	8b 45 14             	mov    0x14(%ebp),%eax
  800696:	8b 10                	mov    (%eax),%edx
  800698:	b9 00 00 00 00       	mov    $0x0,%ecx
  80069d:	8d 40 04             	lea    0x4(%eax),%eax
  8006a0:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8006a3:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  8006a8:	eb 45                	jmp    8006ef <vprintfmt+0x35b>
			putch('X', putdat);
  8006aa:	83 ec 08             	sub    $0x8,%esp
  8006ad:	53                   	push   %ebx
  8006ae:	6a 58                	push   $0x58
  8006b0:	ff d6                	call   *%esi
			putch('X', putdat);
  8006b2:	83 c4 08             	add    $0x8,%esp
  8006b5:	53                   	push   %ebx
  8006b6:	6a 58                	push   $0x58
  8006b8:	ff d6                	call   *%esi
			putch('X', putdat);
  8006ba:	83 c4 08             	add    $0x8,%esp
  8006bd:	53                   	push   %ebx
  8006be:	6a 58                	push   $0x58
  8006c0:	ff d6                	call   *%esi
			break;
  8006c2:	83 c4 10             	add    $0x10,%esp
  8006c5:	eb 42                	jmp    800709 <vprintfmt+0x375>
			putch('0', putdat);
  8006c7:	83 ec 08             	sub    $0x8,%esp
  8006ca:	53                   	push   %ebx
  8006cb:	6a 30                	push   $0x30
  8006cd:	ff d6                	call   *%esi
			putch('x', putdat);
  8006cf:	83 c4 08             	add    $0x8,%esp
  8006d2:	53                   	push   %ebx
  8006d3:	6a 78                	push   $0x78
  8006d5:	ff d6                	call   *%esi
			num = (unsigned long long)
  8006d7:	8b 45 14             	mov    0x14(%ebp),%eax
  8006da:	8b 10                	mov    (%eax),%edx
  8006dc:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8006e1:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  8006e4:	8d 40 04             	lea    0x4(%eax),%eax
  8006e7:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8006ea:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  8006ef:	83 ec 0c             	sub    $0xc,%esp
  8006f2:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  8006f6:	57                   	push   %edi
  8006f7:	ff 75 d4             	pushl  -0x2c(%ebp)
  8006fa:	50                   	push   %eax
  8006fb:	51                   	push   %ecx
  8006fc:	52                   	push   %edx
  8006fd:	89 da                	mov    %ebx,%edx
  8006ff:	89 f0                	mov    %esi,%eax
  800701:	e8 a3 fb ff ff       	call   8002a9 <printnum>
			break;
  800706:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  800709:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  80070c:	83 c7 01             	add    $0x1,%edi
  80070f:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800713:	83 f8 25             	cmp    $0x25,%eax
  800716:	0f 84 93 fc ff ff    	je     8003af <vprintfmt+0x1b>
			if (ch == '\0')
  80071c:	85 c0                	test   %eax,%eax
  80071e:	0f 84 8b 00 00 00    	je     8007af <vprintfmt+0x41b>
			putch(ch, putdat);
  800724:	83 ec 08             	sub    $0x8,%esp
  800727:	53                   	push   %ebx
  800728:	50                   	push   %eax
  800729:	ff d6                	call   *%esi
  80072b:	83 c4 10             	add    $0x10,%esp
  80072e:	eb dc                	jmp    80070c <vprintfmt+0x378>
	if (lflag >= 2)
  800730:	83 f9 01             	cmp    $0x1,%ecx
  800733:	7f 1b                	jg     800750 <vprintfmt+0x3bc>
	else if (lflag)
  800735:	85 c9                	test   %ecx,%ecx
  800737:	74 2c                	je     800765 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  800739:	8b 45 14             	mov    0x14(%ebp),%eax
  80073c:	8b 10                	mov    (%eax),%edx
  80073e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800743:	8d 40 04             	lea    0x4(%eax),%eax
  800746:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800749:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  80074e:	eb 9f                	jmp    8006ef <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800750:	8b 45 14             	mov    0x14(%ebp),%eax
  800753:	8b 10                	mov    (%eax),%edx
  800755:	8b 48 04             	mov    0x4(%eax),%ecx
  800758:	8d 40 08             	lea    0x8(%eax),%eax
  80075b:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80075e:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800763:	eb 8a                	jmp    8006ef <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800765:	8b 45 14             	mov    0x14(%ebp),%eax
  800768:	8b 10                	mov    (%eax),%edx
  80076a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80076f:	8d 40 04             	lea    0x4(%eax),%eax
  800772:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800775:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80077a:	e9 70 ff ff ff       	jmp    8006ef <vprintfmt+0x35b>
			putch(ch, putdat);
  80077f:	83 ec 08             	sub    $0x8,%esp
  800782:	53                   	push   %ebx
  800783:	6a 25                	push   $0x25
  800785:	ff d6                	call   *%esi
			break;
  800787:	83 c4 10             	add    $0x10,%esp
  80078a:	e9 7a ff ff ff       	jmp    800709 <vprintfmt+0x375>
			putch('%', putdat);
  80078f:	83 ec 08             	sub    $0x8,%esp
  800792:	53                   	push   %ebx
  800793:	6a 25                	push   $0x25
  800795:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800797:	83 c4 10             	add    $0x10,%esp
  80079a:	89 f8                	mov    %edi,%eax
  80079c:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  8007a0:	74 05                	je     8007a7 <vprintfmt+0x413>
  8007a2:	83 e8 01             	sub    $0x1,%eax
  8007a5:	eb f5                	jmp    80079c <vprintfmt+0x408>
  8007a7:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8007aa:	e9 5a ff ff ff       	jmp    800709 <vprintfmt+0x375>
}
  8007af:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8007b2:	5b                   	pop    %ebx
  8007b3:	5e                   	pop    %esi
  8007b4:	5f                   	pop    %edi
  8007b5:	5d                   	pop    %ebp
  8007b6:	c3                   	ret    

008007b7 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  8007b7:	f3 0f 1e fb          	endbr32 
  8007bb:	55                   	push   %ebp
  8007bc:	89 e5                	mov    %esp,%ebp
  8007be:	83 ec 18             	sub    $0x18,%esp
  8007c1:	8b 45 08             	mov    0x8(%ebp),%eax
  8007c4:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8007c7:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8007ca:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8007ce:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8007d1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8007d8:	85 c0                	test   %eax,%eax
  8007da:	74 26                	je     800802 <vsnprintf+0x4b>
  8007dc:	85 d2                	test   %edx,%edx
  8007de:	7e 22                	jle    800802 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8007e0:	ff 75 14             	pushl  0x14(%ebp)
  8007e3:	ff 75 10             	pushl  0x10(%ebp)
  8007e6:	8d 45 ec             	lea    -0x14(%ebp),%eax
  8007e9:	50                   	push   %eax
  8007ea:	68 52 03 80 00       	push   $0x800352
  8007ef:	e8 a0 fb ff ff       	call   800394 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  8007f4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  8007f7:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8007fa:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8007fd:	83 c4 10             	add    $0x10,%esp
}
  800800:	c9                   	leave  
  800801:	c3                   	ret    
		return -E_INVAL;
  800802:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800807:	eb f7                	jmp    800800 <vsnprintf+0x49>

00800809 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  800809:	f3 0f 1e fb          	endbr32 
  80080d:	55                   	push   %ebp
  80080e:	89 e5                	mov    %esp,%ebp
  800810:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  800813:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  800816:	50                   	push   %eax
  800817:	ff 75 10             	pushl  0x10(%ebp)
  80081a:	ff 75 0c             	pushl  0xc(%ebp)
  80081d:	ff 75 08             	pushl  0x8(%ebp)
  800820:	e8 92 ff ff ff       	call   8007b7 <vsnprintf>
	va_end(ap);

	return rc;
}
  800825:	c9                   	leave  
  800826:	c3                   	ret    

00800827 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800827:	f3 0f 1e fb          	endbr32 
  80082b:	55                   	push   %ebp
  80082c:	89 e5                	mov    %esp,%ebp
  80082e:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800831:	b8 00 00 00 00       	mov    $0x0,%eax
  800836:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80083a:	74 05                	je     800841 <strlen+0x1a>
		n++;
  80083c:	83 c0 01             	add    $0x1,%eax
  80083f:	eb f5                	jmp    800836 <strlen+0xf>
	return n;
}
  800841:	5d                   	pop    %ebp
  800842:	c3                   	ret    

00800843 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800843:	f3 0f 1e fb          	endbr32 
  800847:	55                   	push   %ebp
  800848:	89 e5                	mov    %esp,%ebp
  80084a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80084d:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800850:	b8 00 00 00 00       	mov    $0x0,%eax
  800855:	39 d0                	cmp    %edx,%eax
  800857:	74 0d                	je     800866 <strnlen+0x23>
  800859:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  80085d:	74 05                	je     800864 <strnlen+0x21>
		n++;
  80085f:	83 c0 01             	add    $0x1,%eax
  800862:	eb f1                	jmp    800855 <strnlen+0x12>
  800864:	89 c2                	mov    %eax,%edx
	return n;
}
  800866:	89 d0                	mov    %edx,%eax
  800868:	5d                   	pop    %ebp
  800869:	c3                   	ret    

0080086a <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80086a:	f3 0f 1e fb          	endbr32 
  80086e:	55                   	push   %ebp
  80086f:	89 e5                	mov    %esp,%ebp
  800871:	53                   	push   %ebx
  800872:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800875:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800878:	b8 00 00 00 00       	mov    $0x0,%eax
  80087d:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800881:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800884:	83 c0 01             	add    $0x1,%eax
  800887:	84 d2                	test   %dl,%dl
  800889:	75 f2                	jne    80087d <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  80088b:	89 c8                	mov    %ecx,%eax
  80088d:	5b                   	pop    %ebx
  80088e:	5d                   	pop    %ebp
  80088f:	c3                   	ret    

00800890 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800890:	f3 0f 1e fb          	endbr32 
  800894:	55                   	push   %ebp
  800895:	89 e5                	mov    %esp,%ebp
  800897:	53                   	push   %ebx
  800898:	83 ec 10             	sub    $0x10,%esp
  80089b:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  80089e:	53                   	push   %ebx
  80089f:	e8 83 ff ff ff       	call   800827 <strlen>
  8008a4:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  8008a7:	ff 75 0c             	pushl  0xc(%ebp)
  8008aa:	01 d8                	add    %ebx,%eax
  8008ac:	50                   	push   %eax
  8008ad:	e8 b8 ff ff ff       	call   80086a <strcpy>
	return dst;
}
  8008b2:	89 d8                	mov    %ebx,%eax
  8008b4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8008b7:	c9                   	leave  
  8008b8:	c3                   	ret    

008008b9 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  8008b9:	f3 0f 1e fb          	endbr32 
  8008bd:	55                   	push   %ebp
  8008be:	89 e5                	mov    %esp,%ebp
  8008c0:	56                   	push   %esi
  8008c1:	53                   	push   %ebx
  8008c2:	8b 75 08             	mov    0x8(%ebp),%esi
  8008c5:	8b 55 0c             	mov    0xc(%ebp),%edx
  8008c8:	89 f3                	mov    %esi,%ebx
  8008ca:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8008cd:	89 f0                	mov    %esi,%eax
  8008cf:	39 d8                	cmp    %ebx,%eax
  8008d1:	74 11                	je     8008e4 <strncpy+0x2b>
		*dst++ = *src;
  8008d3:	83 c0 01             	add    $0x1,%eax
  8008d6:	0f b6 0a             	movzbl (%edx),%ecx
  8008d9:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8008dc:	80 f9 01             	cmp    $0x1,%cl
  8008df:	83 da ff             	sbb    $0xffffffff,%edx
  8008e2:	eb eb                	jmp    8008cf <strncpy+0x16>
	}
	return ret;
}
  8008e4:	89 f0                	mov    %esi,%eax
  8008e6:	5b                   	pop    %ebx
  8008e7:	5e                   	pop    %esi
  8008e8:	5d                   	pop    %ebp
  8008e9:	c3                   	ret    

008008ea <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  8008ea:	f3 0f 1e fb          	endbr32 
  8008ee:	55                   	push   %ebp
  8008ef:	89 e5                	mov    %esp,%ebp
  8008f1:	56                   	push   %esi
  8008f2:	53                   	push   %ebx
  8008f3:	8b 75 08             	mov    0x8(%ebp),%esi
  8008f6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8008f9:	8b 55 10             	mov    0x10(%ebp),%edx
  8008fc:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8008fe:	85 d2                	test   %edx,%edx
  800900:	74 21                	je     800923 <strlcpy+0x39>
  800902:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800906:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  800908:	39 c2                	cmp    %eax,%edx
  80090a:	74 14                	je     800920 <strlcpy+0x36>
  80090c:	0f b6 19             	movzbl (%ecx),%ebx
  80090f:	84 db                	test   %bl,%bl
  800911:	74 0b                	je     80091e <strlcpy+0x34>
			*dst++ = *src++;
  800913:	83 c1 01             	add    $0x1,%ecx
  800916:	83 c2 01             	add    $0x1,%edx
  800919:	88 5a ff             	mov    %bl,-0x1(%edx)
  80091c:	eb ea                	jmp    800908 <strlcpy+0x1e>
  80091e:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800920:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800923:	29 f0                	sub    %esi,%eax
}
  800925:	5b                   	pop    %ebx
  800926:	5e                   	pop    %esi
  800927:	5d                   	pop    %ebp
  800928:	c3                   	ret    

00800929 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  800929:	f3 0f 1e fb          	endbr32 
  80092d:	55                   	push   %ebp
  80092e:	89 e5                	mov    %esp,%ebp
  800930:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800933:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800936:	0f b6 01             	movzbl (%ecx),%eax
  800939:	84 c0                	test   %al,%al
  80093b:	74 0c                	je     800949 <strcmp+0x20>
  80093d:	3a 02                	cmp    (%edx),%al
  80093f:	75 08                	jne    800949 <strcmp+0x20>
		p++, q++;
  800941:	83 c1 01             	add    $0x1,%ecx
  800944:	83 c2 01             	add    $0x1,%edx
  800947:	eb ed                	jmp    800936 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800949:	0f b6 c0             	movzbl %al,%eax
  80094c:	0f b6 12             	movzbl (%edx),%edx
  80094f:	29 d0                	sub    %edx,%eax
}
  800951:	5d                   	pop    %ebp
  800952:	c3                   	ret    

00800953 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800953:	f3 0f 1e fb          	endbr32 
  800957:	55                   	push   %ebp
  800958:	89 e5                	mov    %esp,%ebp
  80095a:	53                   	push   %ebx
  80095b:	8b 45 08             	mov    0x8(%ebp),%eax
  80095e:	8b 55 0c             	mov    0xc(%ebp),%edx
  800961:	89 c3                	mov    %eax,%ebx
  800963:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800966:	eb 06                	jmp    80096e <strncmp+0x1b>
		n--, p++, q++;
  800968:	83 c0 01             	add    $0x1,%eax
  80096b:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  80096e:	39 d8                	cmp    %ebx,%eax
  800970:	74 16                	je     800988 <strncmp+0x35>
  800972:	0f b6 08             	movzbl (%eax),%ecx
  800975:	84 c9                	test   %cl,%cl
  800977:	74 04                	je     80097d <strncmp+0x2a>
  800979:	3a 0a                	cmp    (%edx),%cl
  80097b:	74 eb                	je     800968 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  80097d:	0f b6 00             	movzbl (%eax),%eax
  800980:	0f b6 12             	movzbl (%edx),%edx
  800983:	29 d0                	sub    %edx,%eax
}
  800985:	5b                   	pop    %ebx
  800986:	5d                   	pop    %ebp
  800987:	c3                   	ret    
		return 0;
  800988:	b8 00 00 00 00       	mov    $0x0,%eax
  80098d:	eb f6                	jmp    800985 <strncmp+0x32>

0080098f <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  80098f:	f3 0f 1e fb          	endbr32 
  800993:	55                   	push   %ebp
  800994:	89 e5                	mov    %esp,%ebp
  800996:	8b 45 08             	mov    0x8(%ebp),%eax
  800999:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80099d:	0f b6 10             	movzbl (%eax),%edx
  8009a0:	84 d2                	test   %dl,%dl
  8009a2:	74 09                	je     8009ad <strchr+0x1e>
		if (*s == c)
  8009a4:	38 ca                	cmp    %cl,%dl
  8009a6:	74 0a                	je     8009b2 <strchr+0x23>
	for (; *s; s++)
  8009a8:	83 c0 01             	add    $0x1,%eax
  8009ab:	eb f0                	jmp    80099d <strchr+0xe>
			return (char *) s;
	return 0;
  8009ad:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009b2:	5d                   	pop    %ebp
  8009b3:	c3                   	ret    

008009b4 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  8009b4:	f3 0f 1e fb          	endbr32 
  8009b8:	55                   	push   %ebp
  8009b9:	89 e5                	mov    %esp,%ebp
  8009bb:	8b 45 08             	mov    0x8(%ebp),%eax
  8009be:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8009c2:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8009c5:	38 ca                	cmp    %cl,%dl
  8009c7:	74 09                	je     8009d2 <strfind+0x1e>
  8009c9:	84 d2                	test   %dl,%dl
  8009cb:	74 05                	je     8009d2 <strfind+0x1e>
	for (; *s; s++)
  8009cd:	83 c0 01             	add    $0x1,%eax
  8009d0:	eb f0                	jmp    8009c2 <strfind+0xe>
			break;
	return (char *) s;
}
  8009d2:	5d                   	pop    %ebp
  8009d3:	c3                   	ret    

008009d4 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8009d4:	f3 0f 1e fb          	endbr32 
  8009d8:	55                   	push   %ebp
  8009d9:	89 e5                	mov    %esp,%ebp
  8009db:	57                   	push   %edi
  8009dc:	56                   	push   %esi
  8009dd:	53                   	push   %ebx
  8009de:	8b 7d 08             	mov    0x8(%ebp),%edi
  8009e1:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8009e4:	85 c9                	test   %ecx,%ecx
  8009e6:	74 31                	je     800a19 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8009e8:	89 f8                	mov    %edi,%eax
  8009ea:	09 c8                	or     %ecx,%eax
  8009ec:	a8 03                	test   $0x3,%al
  8009ee:	75 23                	jne    800a13 <memset+0x3f>
		c &= 0xFF;
  8009f0:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8009f4:	89 d3                	mov    %edx,%ebx
  8009f6:	c1 e3 08             	shl    $0x8,%ebx
  8009f9:	89 d0                	mov    %edx,%eax
  8009fb:	c1 e0 18             	shl    $0x18,%eax
  8009fe:	89 d6                	mov    %edx,%esi
  800a00:	c1 e6 10             	shl    $0x10,%esi
  800a03:	09 f0                	or     %esi,%eax
  800a05:	09 c2                	or     %eax,%edx
  800a07:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  800a09:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  800a0c:	89 d0                	mov    %edx,%eax
  800a0e:	fc                   	cld    
  800a0f:	f3 ab                	rep stos %eax,%es:(%edi)
  800a11:	eb 06                	jmp    800a19 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800a13:	8b 45 0c             	mov    0xc(%ebp),%eax
  800a16:	fc                   	cld    
  800a17:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  800a19:	89 f8                	mov    %edi,%eax
  800a1b:	5b                   	pop    %ebx
  800a1c:	5e                   	pop    %esi
  800a1d:	5f                   	pop    %edi
  800a1e:	5d                   	pop    %ebp
  800a1f:	c3                   	ret    

00800a20 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800a20:	f3 0f 1e fb          	endbr32 
  800a24:	55                   	push   %ebp
  800a25:	89 e5                	mov    %esp,%ebp
  800a27:	57                   	push   %edi
  800a28:	56                   	push   %esi
  800a29:	8b 45 08             	mov    0x8(%ebp),%eax
  800a2c:	8b 75 0c             	mov    0xc(%ebp),%esi
  800a2f:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800a32:	39 c6                	cmp    %eax,%esi
  800a34:	73 32                	jae    800a68 <memmove+0x48>
  800a36:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800a39:	39 c2                	cmp    %eax,%edx
  800a3b:	76 2b                	jbe    800a68 <memmove+0x48>
		s += n;
		d += n;
  800a3d:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800a40:	89 fe                	mov    %edi,%esi
  800a42:	09 ce                	or     %ecx,%esi
  800a44:	09 d6                	or     %edx,%esi
  800a46:	f7 c6 03 00 00 00    	test   $0x3,%esi
  800a4c:	75 0e                	jne    800a5c <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800a4e:	83 ef 04             	sub    $0x4,%edi
  800a51:	8d 72 fc             	lea    -0x4(%edx),%esi
  800a54:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800a57:	fd                   	std    
  800a58:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a5a:	eb 09                	jmp    800a65 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  800a5c:	83 ef 01             	sub    $0x1,%edi
  800a5f:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800a62:	fd                   	std    
  800a63:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800a65:	fc                   	cld    
  800a66:	eb 1a                	jmp    800a82 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800a68:	89 c2                	mov    %eax,%edx
  800a6a:	09 ca                	or     %ecx,%edx
  800a6c:	09 f2                	or     %esi,%edx
  800a6e:	f6 c2 03             	test   $0x3,%dl
  800a71:	75 0a                	jne    800a7d <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800a73:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800a76:	89 c7                	mov    %eax,%edi
  800a78:	fc                   	cld    
  800a79:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a7b:	eb 05                	jmp    800a82 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800a7d:	89 c7                	mov    %eax,%edi
  800a7f:	fc                   	cld    
  800a80:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800a82:	5e                   	pop    %esi
  800a83:	5f                   	pop    %edi
  800a84:	5d                   	pop    %ebp
  800a85:	c3                   	ret    

00800a86 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800a86:	f3 0f 1e fb          	endbr32 
  800a8a:	55                   	push   %ebp
  800a8b:	89 e5                	mov    %esp,%ebp
  800a8d:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800a90:	ff 75 10             	pushl  0x10(%ebp)
  800a93:	ff 75 0c             	pushl  0xc(%ebp)
  800a96:	ff 75 08             	pushl  0x8(%ebp)
  800a99:	e8 82 ff ff ff       	call   800a20 <memmove>
}
  800a9e:	c9                   	leave  
  800a9f:	c3                   	ret    

00800aa0 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800aa0:	f3 0f 1e fb          	endbr32 
  800aa4:	55                   	push   %ebp
  800aa5:	89 e5                	mov    %esp,%ebp
  800aa7:	56                   	push   %esi
  800aa8:	53                   	push   %ebx
  800aa9:	8b 45 08             	mov    0x8(%ebp),%eax
  800aac:	8b 55 0c             	mov    0xc(%ebp),%edx
  800aaf:	89 c6                	mov    %eax,%esi
  800ab1:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800ab4:	39 f0                	cmp    %esi,%eax
  800ab6:	74 1c                	je     800ad4 <memcmp+0x34>
		if (*s1 != *s2)
  800ab8:	0f b6 08             	movzbl (%eax),%ecx
  800abb:	0f b6 1a             	movzbl (%edx),%ebx
  800abe:	38 d9                	cmp    %bl,%cl
  800ac0:	75 08                	jne    800aca <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800ac2:	83 c0 01             	add    $0x1,%eax
  800ac5:	83 c2 01             	add    $0x1,%edx
  800ac8:	eb ea                	jmp    800ab4 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  800aca:	0f b6 c1             	movzbl %cl,%eax
  800acd:	0f b6 db             	movzbl %bl,%ebx
  800ad0:	29 d8                	sub    %ebx,%eax
  800ad2:	eb 05                	jmp    800ad9 <memcmp+0x39>
	}

	return 0;
  800ad4:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800ad9:	5b                   	pop    %ebx
  800ada:	5e                   	pop    %esi
  800adb:	5d                   	pop    %ebp
  800adc:	c3                   	ret    

00800add <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800add:	f3 0f 1e fb          	endbr32 
  800ae1:	55                   	push   %ebp
  800ae2:	89 e5                	mov    %esp,%ebp
  800ae4:	8b 45 08             	mov    0x8(%ebp),%eax
  800ae7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800aea:	89 c2                	mov    %eax,%edx
  800aec:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800aef:	39 d0                	cmp    %edx,%eax
  800af1:	73 09                	jae    800afc <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800af3:	38 08                	cmp    %cl,(%eax)
  800af5:	74 05                	je     800afc <memfind+0x1f>
	for (; s < ends; s++)
  800af7:	83 c0 01             	add    $0x1,%eax
  800afa:	eb f3                	jmp    800aef <memfind+0x12>
			break;
	return (void *) s;
}
  800afc:	5d                   	pop    %ebp
  800afd:	c3                   	ret    

00800afe <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800afe:	f3 0f 1e fb          	endbr32 
  800b02:	55                   	push   %ebp
  800b03:	89 e5                	mov    %esp,%ebp
  800b05:	57                   	push   %edi
  800b06:	56                   	push   %esi
  800b07:	53                   	push   %ebx
  800b08:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800b0b:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800b0e:	eb 03                	jmp    800b13 <strtol+0x15>
		s++;
  800b10:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800b13:	0f b6 01             	movzbl (%ecx),%eax
  800b16:	3c 20                	cmp    $0x20,%al
  800b18:	74 f6                	je     800b10 <strtol+0x12>
  800b1a:	3c 09                	cmp    $0x9,%al
  800b1c:	74 f2                	je     800b10 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800b1e:	3c 2b                	cmp    $0x2b,%al
  800b20:	74 2a                	je     800b4c <strtol+0x4e>
	int neg = 0;
  800b22:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800b27:	3c 2d                	cmp    $0x2d,%al
  800b29:	74 2b                	je     800b56 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800b2b:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800b31:	75 0f                	jne    800b42 <strtol+0x44>
  800b33:	80 39 30             	cmpb   $0x30,(%ecx)
  800b36:	74 28                	je     800b60 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800b38:	85 db                	test   %ebx,%ebx
  800b3a:	b8 0a 00 00 00       	mov    $0xa,%eax
  800b3f:	0f 44 d8             	cmove  %eax,%ebx
  800b42:	b8 00 00 00 00       	mov    $0x0,%eax
  800b47:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800b4a:	eb 46                	jmp    800b92 <strtol+0x94>
		s++;
  800b4c:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800b4f:	bf 00 00 00 00       	mov    $0x0,%edi
  800b54:	eb d5                	jmp    800b2b <strtol+0x2d>
		s++, neg = 1;
  800b56:	83 c1 01             	add    $0x1,%ecx
  800b59:	bf 01 00 00 00       	mov    $0x1,%edi
  800b5e:	eb cb                	jmp    800b2b <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800b60:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800b64:	74 0e                	je     800b74 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800b66:	85 db                	test   %ebx,%ebx
  800b68:	75 d8                	jne    800b42 <strtol+0x44>
		s++, base = 8;
  800b6a:	83 c1 01             	add    $0x1,%ecx
  800b6d:	bb 08 00 00 00       	mov    $0x8,%ebx
  800b72:	eb ce                	jmp    800b42 <strtol+0x44>
		s += 2, base = 16;
  800b74:	83 c1 02             	add    $0x2,%ecx
  800b77:	bb 10 00 00 00       	mov    $0x10,%ebx
  800b7c:	eb c4                	jmp    800b42 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800b7e:	0f be d2             	movsbl %dl,%edx
  800b81:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800b84:	3b 55 10             	cmp    0x10(%ebp),%edx
  800b87:	7d 3a                	jge    800bc3 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800b89:	83 c1 01             	add    $0x1,%ecx
  800b8c:	0f af 45 10          	imul   0x10(%ebp),%eax
  800b90:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800b92:	0f b6 11             	movzbl (%ecx),%edx
  800b95:	8d 72 d0             	lea    -0x30(%edx),%esi
  800b98:	89 f3                	mov    %esi,%ebx
  800b9a:	80 fb 09             	cmp    $0x9,%bl
  800b9d:	76 df                	jbe    800b7e <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800b9f:	8d 72 9f             	lea    -0x61(%edx),%esi
  800ba2:	89 f3                	mov    %esi,%ebx
  800ba4:	80 fb 19             	cmp    $0x19,%bl
  800ba7:	77 08                	ja     800bb1 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800ba9:	0f be d2             	movsbl %dl,%edx
  800bac:	83 ea 57             	sub    $0x57,%edx
  800baf:	eb d3                	jmp    800b84 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800bb1:	8d 72 bf             	lea    -0x41(%edx),%esi
  800bb4:	89 f3                	mov    %esi,%ebx
  800bb6:	80 fb 19             	cmp    $0x19,%bl
  800bb9:	77 08                	ja     800bc3 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800bbb:	0f be d2             	movsbl %dl,%edx
  800bbe:	83 ea 37             	sub    $0x37,%edx
  800bc1:	eb c1                	jmp    800b84 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800bc3:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800bc7:	74 05                	je     800bce <strtol+0xd0>
		*endptr = (char *) s;
  800bc9:	8b 75 0c             	mov    0xc(%ebp),%esi
  800bcc:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800bce:	89 c2                	mov    %eax,%edx
  800bd0:	f7 da                	neg    %edx
  800bd2:	85 ff                	test   %edi,%edi
  800bd4:	0f 45 c2             	cmovne %edx,%eax
}
  800bd7:	5b                   	pop    %ebx
  800bd8:	5e                   	pop    %esi
  800bd9:	5f                   	pop    %edi
  800bda:	5d                   	pop    %ebp
  800bdb:	c3                   	ret    

00800bdc <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800bdc:	f3 0f 1e fb          	endbr32 
  800be0:	55                   	push   %ebp
  800be1:	89 e5                	mov    %esp,%ebp
  800be3:	57                   	push   %edi
  800be4:	56                   	push   %esi
  800be5:	53                   	push   %ebx
	asm volatile("int %1\n"
  800be6:	b8 00 00 00 00       	mov    $0x0,%eax
  800beb:	8b 55 08             	mov    0x8(%ebp),%edx
  800bee:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800bf1:	89 c3                	mov    %eax,%ebx
  800bf3:	89 c7                	mov    %eax,%edi
  800bf5:	89 c6                	mov    %eax,%esi
  800bf7:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800bf9:	5b                   	pop    %ebx
  800bfa:	5e                   	pop    %esi
  800bfb:	5f                   	pop    %edi
  800bfc:	5d                   	pop    %ebp
  800bfd:	c3                   	ret    

00800bfe <sys_cgetc>:

int
sys_cgetc(void)
{
  800bfe:	f3 0f 1e fb          	endbr32 
  800c02:	55                   	push   %ebp
  800c03:	89 e5                	mov    %esp,%ebp
  800c05:	57                   	push   %edi
  800c06:	56                   	push   %esi
  800c07:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c08:	ba 00 00 00 00       	mov    $0x0,%edx
  800c0d:	b8 01 00 00 00       	mov    $0x1,%eax
  800c12:	89 d1                	mov    %edx,%ecx
  800c14:	89 d3                	mov    %edx,%ebx
  800c16:	89 d7                	mov    %edx,%edi
  800c18:	89 d6                	mov    %edx,%esi
  800c1a:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800c1c:	5b                   	pop    %ebx
  800c1d:	5e                   	pop    %esi
  800c1e:	5f                   	pop    %edi
  800c1f:	5d                   	pop    %ebp
  800c20:	c3                   	ret    

00800c21 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800c21:	f3 0f 1e fb          	endbr32 
  800c25:	55                   	push   %ebp
  800c26:	89 e5                	mov    %esp,%ebp
  800c28:	57                   	push   %edi
  800c29:	56                   	push   %esi
  800c2a:	53                   	push   %ebx
  800c2b:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c2e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800c33:	8b 55 08             	mov    0x8(%ebp),%edx
  800c36:	b8 03 00 00 00       	mov    $0x3,%eax
  800c3b:	89 cb                	mov    %ecx,%ebx
  800c3d:	89 cf                	mov    %ecx,%edi
  800c3f:	89 ce                	mov    %ecx,%esi
  800c41:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c43:	85 c0                	test   %eax,%eax
  800c45:	7f 08                	jg     800c4f <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800c47:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c4a:	5b                   	pop    %ebx
  800c4b:	5e                   	pop    %esi
  800c4c:	5f                   	pop    %edi
  800c4d:	5d                   	pop    %ebp
  800c4e:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c4f:	83 ec 0c             	sub    $0xc,%esp
  800c52:	50                   	push   %eax
  800c53:	6a 03                	push   $0x3
  800c55:	68 df 29 80 00       	push   $0x8029df
  800c5a:	6a 23                	push   $0x23
  800c5c:	68 fc 29 80 00       	push   $0x8029fc
  800c61:	e8 44 f5 ff ff       	call   8001aa <_panic>

00800c66 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800c66:	f3 0f 1e fb          	endbr32 
  800c6a:	55                   	push   %ebp
  800c6b:	89 e5                	mov    %esp,%ebp
  800c6d:	57                   	push   %edi
  800c6e:	56                   	push   %esi
  800c6f:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c70:	ba 00 00 00 00       	mov    $0x0,%edx
  800c75:	b8 02 00 00 00       	mov    $0x2,%eax
  800c7a:	89 d1                	mov    %edx,%ecx
  800c7c:	89 d3                	mov    %edx,%ebx
  800c7e:	89 d7                	mov    %edx,%edi
  800c80:	89 d6                	mov    %edx,%esi
  800c82:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800c84:	5b                   	pop    %ebx
  800c85:	5e                   	pop    %esi
  800c86:	5f                   	pop    %edi
  800c87:	5d                   	pop    %ebp
  800c88:	c3                   	ret    

00800c89 <sys_yield>:

void
sys_yield(void)
{
  800c89:	f3 0f 1e fb          	endbr32 
  800c8d:	55                   	push   %ebp
  800c8e:	89 e5                	mov    %esp,%ebp
  800c90:	57                   	push   %edi
  800c91:	56                   	push   %esi
  800c92:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c93:	ba 00 00 00 00       	mov    $0x0,%edx
  800c98:	b8 0b 00 00 00       	mov    $0xb,%eax
  800c9d:	89 d1                	mov    %edx,%ecx
  800c9f:	89 d3                	mov    %edx,%ebx
  800ca1:	89 d7                	mov    %edx,%edi
  800ca3:	89 d6                	mov    %edx,%esi
  800ca5:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800ca7:	5b                   	pop    %ebx
  800ca8:	5e                   	pop    %esi
  800ca9:	5f                   	pop    %edi
  800caa:	5d                   	pop    %ebp
  800cab:	c3                   	ret    

00800cac <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800cac:	f3 0f 1e fb          	endbr32 
  800cb0:	55                   	push   %ebp
  800cb1:	89 e5                	mov    %esp,%ebp
  800cb3:	57                   	push   %edi
  800cb4:	56                   	push   %esi
  800cb5:	53                   	push   %ebx
  800cb6:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cb9:	be 00 00 00 00       	mov    $0x0,%esi
  800cbe:	8b 55 08             	mov    0x8(%ebp),%edx
  800cc1:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cc4:	b8 04 00 00 00       	mov    $0x4,%eax
  800cc9:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800ccc:	89 f7                	mov    %esi,%edi
  800cce:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cd0:	85 c0                	test   %eax,%eax
  800cd2:	7f 08                	jg     800cdc <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800cd4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cd7:	5b                   	pop    %ebx
  800cd8:	5e                   	pop    %esi
  800cd9:	5f                   	pop    %edi
  800cda:	5d                   	pop    %ebp
  800cdb:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cdc:	83 ec 0c             	sub    $0xc,%esp
  800cdf:	50                   	push   %eax
  800ce0:	6a 04                	push   $0x4
  800ce2:	68 df 29 80 00       	push   $0x8029df
  800ce7:	6a 23                	push   $0x23
  800ce9:	68 fc 29 80 00       	push   $0x8029fc
  800cee:	e8 b7 f4 ff ff       	call   8001aa <_panic>

00800cf3 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800cf3:	f3 0f 1e fb          	endbr32 
  800cf7:	55                   	push   %ebp
  800cf8:	89 e5                	mov    %esp,%ebp
  800cfa:	57                   	push   %edi
  800cfb:	56                   	push   %esi
  800cfc:	53                   	push   %ebx
  800cfd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d00:	8b 55 08             	mov    0x8(%ebp),%edx
  800d03:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d06:	b8 05 00 00 00       	mov    $0x5,%eax
  800d0b:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d0e:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d11:	8b 75 18             	mov    0x18(%ebp),%esi
  800d14:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d16:	85 c0                	test   %eax,%eax
  800d18:	7f 08                	jg     800d22 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800d1a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d1d:	5b                   	pop    %ebx
  800d1e:	5e                   	pop    %esi
  800d1f:	5f                   	pop    %edi
  800d20:	5d                   	pop    %ebp
  800d21:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d22:	83 ec 0c             	sub    $0xc,%esp
  800d25:	50                   	push   %eax
  800d26:	6a 05                	push   $0x5
  800d28:	68 df 29 80 00       	push   $0x8029df
  800d2d:	6a 23                	push   $0x23
  800d2f:	68 fc 29 80 00       	push   $0x8029fc
  800d34:	e8 71 f4 ff ff       	call   8001aa <_panic>

00800d39 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800d39:	f3 0f 1e fb          	endbr32 
  800d3d:	55                   	push   %ebp
  800d3e:	89 e5                	mov    %esp,%ebp
  800d40:	57                   	push   %edi
  800d41:	56                   	push   %esi
  800d42:	53                   	push   %ebx
  800d43:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d46:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d4b:	8b 55 08             	mov    0x8(%ebp),%edx
  800d4e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d51:	b8 06 00 00 00       	mov    $0x6,%eax
  800d56:	89 df                	mov    %ebx,%edi
  800d58:	89 de                	mov    %ebx,%esi
  800d5a:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d5c:	85 c0                	test   %eax,%eax
  800d5e:	7f 08                	jg     800d68 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800d60:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d63:	5b                   	pop    %ebx
  800d64:	5e                   	pop    %esi
  800d65:	5f                   	pop    %edi
  800d66:	5d                   	pop    %ebp
  800d67:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d68:	83 ec 0c             	sub    $0xc,%esp
  800d6b:	50                   	push   %eax
  800d6c:	6a 06                	push   $0x6
  800d6e:	68 df 29 80 00       	push   $0x8029df
  800d73:	6a 23                	push   $0x23
  800d75:	68 fc 29 80 00       	push   $0x8029fc
  800d7a:	e8 2b f4 ff ff       	call   8001aa <_panic>

00800d7f <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800d7f:	f3 0f 1e fb          	endbr32 
  800d83:	55                   	push   %ebp
  800d84:	89 e5                	mov    %esp,%ebp
  800d86:	57                   	push   %edi
  800d87:	56                   	push   %esi
  800d88:	53                   	push   %ebx
  800d89:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d8c:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d91:	8b 55 08             	mov    0x8(%ebp),%edx
  800d94:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d97:	b8 08 00 00 00       	mov    $0x8,%eax
  800d9c:	89 df                	mov    %ebx,%edi
  800d9e:	89 de                	mov    %ebx,%esi
  800da0:	cd 30                	int    $0x30
	if(check && ret > 0)
  800da2:	85 c0                	test   %eax,%eax
  800da4:	7f 08                	jg     800dae <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800da6:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800da9:	5b                   	pop    %ebx
  800daa:	5e                   	pop    %esi
  800dab:	5f                   	pop    %edi
  800dac:	5d                   	pop    %ebp
  800dad:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800dae:	83 ec 0c             	sub    $0xc,%esp
  800db1:	50                   	push   %eax
  800db2:	6a 08                	push   $0x8
  800db4:	68 df 29 80 00       	push   $0x8029df
  800db9:	6a 23                	push   $0x23
  800dbb:	68 fc 29 80 00       	push   $0x8029fc
  800dc0:	e8 e5 f3 ff ff       	call   8001aa <_panic>

00800dc5 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800dc5:	f3 0f 1e fb          	endbr32 
  800dc9:	55                   	push   %ebp
  800dca:	89 e5                	mov    %esp,%ebp
  800dcc:	57                   	push   %edi
  800dcd:	56                   	push   %esi
  800dce:	53                   	push   %ebx
  800dcf:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800dd2:	bb 00 00 00 00       	mov    $0x0,%ebx
  800dd7:	8b 55 08             	mov    0x8(%ebp),%edx
  800dda:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ddd:	b8 09 00 00 00       	mov    $0x9,%eax
  800de2:	89 df                	mov    %ebx,%edi
  800de4:	89 de                	mov    %ebx,%esi
  800de6:	cd 30                	int    $0x30
	if(check && ret > 0)
  800de8:	85 c0                	test   %eax,%eax
  800dea:	7f 08                	jg     800df4 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800dec:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800def:	5b                   	pop    %ebx
  800df0:	5e                   	pop    %esi
  800df1:	5f                   	pop    %edi
  800df2:	5d                   	pop    %ebp
  800df3:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800df4:	83 ec 0c             	sub    $0xc,%esp
  800df7:	50                   	push   %eax
  800df8:	6a 09                	push   $0x9
  800dfa:	68 df 29 80 00       	push   $0x8029df
  800dff:	6a 23                	push   $0x23
  800e01:	68 fc 29 80 00       	push   $0x8029fc
  800e06:	e8 9f f3 ff ff       	call   8001aa <_panic>

00800e0b <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800e0b:	f3 0f 1e fb          	endbr32 
  800e0f:	55                   	push   %ebp
  800e10:	89 e5                	mov    %esp,%ebp
  800e12:	57                   	push   %edi
  800e13:	56                   	push   %esi
  800e14:	53                   	push   %ebx
  800e15:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e18:	bb 00 00 00 00       	mov    $0x0,%ebx
  800e1d:	8b 55 08             	mov    0x8(%ebp),%edx
  800e20:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e23:	b8 0a 00 00 00       	mov    $0xa,%eax
  800e28:	89 df                	mov    %ebx,%edi
  800e2a:	89 de                	mov    %ebx,%esi
  800e2c:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e2e:	85 c0                	test   %eax,%eax
  800e30:	7f 08                	jg     800e3a <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800e32:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800e35:	5b                   	pop    %ebx
  800e36:	5e                   	pop    %esi
  800e37:	5f                   	pop    %edi
  800e38:	5d                   	pop    %ebp
  800e39:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800e3a:	83 ec 0c             	sub    $0xc,%esp
  800e3d:	50                   	push   %eax
  800e3e:	6a 0a                	push   $0xa
  800e40:	68 df 29 80 00       	push   $0x8029df
  800e45:	6a 23                	push   $0x23
  800e47:	68 fc 29 80 00       	push   $0x8029fc
  800e4c:	e8 59 f3 ff ff       	call   8001aa <_panic>

00800e51 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800e51:	f3 0f 1e fb          	endbr32 
  800e55:	55                   	push   %ebp
  800e56:	89 e5                	mov    %esp,%ebp
  800e58:	57                   	push   %edi
  800e59:	56                   	push   %esi
  800e5a:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e5b:	8b 55 08             	mov    0x8(%ebp),%edx
  800e5e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e61:	b8 0c 00 00 00       	mov    $0xc,%eax
  800e66:	be 00 00 00 00       	mov    $0x0,%esi
  800e6b:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800e6e:	8b 7d 14             	mov    0x14(%ebp),%edi
  800e71:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800e73:	5b                   	pop    %ebx
  800e74:	5e                   	pop    %esi
  800e75:	5f                   	pop    %edi
  800e76:	5d                   	pop    %ebp
  800e77:	c3                   	ret    

00800e78 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800e78:	f3 0f 1e fb          	endbr32 
  800e7c:	55                   	push   %ebp
  800e7d:	89 e5                	mov    %esp,%ebp
  800e7f:	57                   	push   %edi
  800e80:	56                   	push   %esi
  800e81:	53                   	push   %ebx
  800e82:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e85:	b9 00 00 00 00       	mov    $0x0,%ecx
  800e8a:	8b 55 08             	mov    0x8(%ebp),%edx
  800e8d:	b8 0d 00 00 00       	mov    $0xd,%eax
  800e92:	89 cb                	mov    %ecx,%ebx
  800e94:	89 cf                	mov    %ecx,%edi
  800e96:	89 ce                	mov    %ecx,%esi
  800e98:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e9a:	85 c0                	test   %eax,%eax
  800e9c:	7f 08                	jg     800ea6 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800e9e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ea1:	5b                   	pop    %ebx
  800ea2:	5e                   	pop    %esi
  800ea3:	5f                   	pop    %edi
  800ea4:	5d                   	pop    %ebp
  800ea5:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800ea6:	83 ec 0c             	sub    $0xc,%esp
  800ea9:	50                   	push   %eax
  800eaa:	6a 0d                	push   $0xd
  800eac:	68 df 29 80 00       	push   $0x8029df
  800eb1:	6a 23                	push   $0x23
  800eb3:	68 fc 29 80 00       	push   $0x8029fc
  800eb8:	e8 ed f2 ff ff       	call   8001aa <_panic>

00800ebd <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800ebd:	f3 0f 1e fb          	endbr32 
  800ec1:	55                   	push   %ebp
  800ec2:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ec4:	8b 45 08             	mov    0x8(%ebp),%eax
  800ec7:	05 00 00 00 30       	add    $0x30000000,%eax
  800ecc:	c1 e8 0c             	shr    $0xc,%eax
}
  800ecf:	5d                   	pop    %ebp
  800ed0:	c3                   	ret    

00800ed1 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800ed1:	f3 0f 1e fb          	endbr32 
  800ed5:	55                   	push   %ebp
  800ed6:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ed8:	8b 45 08             	mov    0x8(%ebp),%eax
  800edb:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800ee0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800ee5:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800eea:	5d                   	pop    %ebp
  800eeb:	c3                   	ret    

00800eec <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800eec:	f3 0f 1e fb          	endbr32 
  800ef0:	55                   	push   %ebp
  800ef1:	89 e5                	mov    %esp,%ebp
  800ef3:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800ef8:	89 c2                	mov    %eax,%edx
  800efa:	c1 ea 16             	shr    $0x16,%edx
  800efd:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800f04:	f6 c2 01             	test   $0x1,%dl
  800f07:	74 2d                	je     800f36 <fd_alloc+0x4a>
  800f09:	89 c2                	mov    %eax,%edx
  800f0b:	c1 ea 0c             	shr    $0xc,%edx
  800f0e:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f15:	f6 c2 01             	test   $0x1,%dl
  800f18:	74 1c                	je     800f36 <fd_alloc+0x4a>
  800f1a:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800f1f:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800f24:	75 d2                	jne    800ef8 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800f26:	8b 45 08             	mov    0x8(%ebp),%eax
  800f29:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800f2f:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800f34:	eb 0a                	jmp    800f40 <fd_alloc+0x54>
			*fd_store = fd;
  800f36:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800f39:	89 01                	mov    %eax,(%ecx)
			return 0;
  800f3b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f40:	5d                   	pop    %ebp
  800f41:	c3                   	ret    

00800f42 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800f42:	f3 0f 1e fb          	endbr32 
  800f46:	55                   	push   %ebp
  800f47:	89 e5                	mov    %esp,%ebp
  800f49:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800f4c:	83 f8 1f             	cmp    $0x1f,%eax
  800f4f:	77 30                	ja     800f81 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800f51:	c1 e0 0c             	shl    $0xc,%eax
  800f54:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800f59:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800f5f:	f6 c2 01             	test   $0x1,%dl
  800f62:	74 24                	je     800f88 <fd_lookup+0x46>
  800f64:	89 c2                	mov    %eax,%edx
  800f66:	c1 ea 0c             	shr    $0xc,%edx
  800f69:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f70:	f6 c2 01             	test   $0x1,%dl
  800f73:	74 1a                	je     800f8f <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800f75:	8b 55 0c             	mov    0xc(%ebp),%edx
  800f78:	89 02                	mov    %eax,(%edx)
	return 0;
  800f7a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f7f:	5d                   	pop    %ebp
  800f80:	c3                   	ret    
		return -E_INVAL;
  800f81:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f86:	eb f7                	jmp    800f7f <fd_lookup+0x3d>
		return -E_INVAL;
  800f88:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f8d:	eb f0                	jmp    800f7f <fd_lookup+0x3d>
  800f8f:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f94:	eb e9                	jmp    800f7f <fd_lookup+0x3d>

00800f96 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800f96:	f3 0f 1e fb          	endbr32 
  800f9a:	55                   	push   %ebp
  800f9b:	89 e5                	mov    %esp,%ebp
  800f9d:	83 ec 08             	sub    $0x8,%esp
  800fa0:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800fa3:	ba 88 2a 80 00       	mov    $0x802a88,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800fa8:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800fad:	39 08                	cmp    %ecx,(%eax)
  800faf:	74 33                	je     800fe4 <dev_lookup+0x4e>
  800fb1:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800fb4:	8b 02                	mov    (%edx),%eax
  800fb6:	85 c0                	test   %eax,%eax
  800fb8:	75 f3                	jne    800fad <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800fba:	a1 04 40 80 00       	mov    0x804004,%eax
  800fbf:	8b 40 48             	mov    0x48(%eax),%eax
  800fc2:	83 ec 04             	sub    $0x4,%esp
  800fc5:	51                   	push   %ecx
  800fc6:	50                   	push   %eax
  800fc7:	68 0c 2a 80 00       	push   $0x802a0c
  800fcc:	e8 c0 f2 ff ff       	call   800291 <cprintf>
	*dev = 0;
  800fd1:	8b 45 0c             	mov    0xc(%ebp),%eax
  800fd4:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800fda:	83 c4 10             	add    $0x10,%esp
  800fdd:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800fe2:	c9                   	leave  
  800fe3:	c3                   	ret    
			*dev = devtab[i];
  800fe4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800fe7:	89 01                	mov    %eax,(%ecx)
			return 0;
  800fe9:	b8 00 00 00 00       	mov    $0x0,%eax
  800fee:	eb f2                	jmp    800fe2 <dev_lookup+0x4c>

00800ff0 <fd_close>:
{
  800ff0:	f3 0f 1e fb          	endbr32 
  800ff4:	55                   	push   %ebp
  800ff5:	89 e5                	mov    %esp,%ebp
  800ff7:	57                   	push   %edi
  800ff8:	56                   	push   %esi
  800ff9:	53                   	push   %ebx
  800ffa:	83 ec 24             	sub    $0x24,%esp
  800ffd:	8b 75 08             	mov    0x8(%ebp),%esi
  801000:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801003:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  801006:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  801007:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  80100d:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801010:	50                   	push   %eax
  801011:	e8 2c ff ff ff       	call   800f42 <fd_lookup>
  801016:	89 c3                	mov    %eax,%ebx
  801018:	83 c4 10             	add    $0x10,%esp
  80101b:	85 c0                	test   %eax,%eax
  80101d:	78 05                	js     801024 <fd_close+0x34>
	    || fd != fd2)
  80101f:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  801022:	74 16                	je     80103a <fd_close+0x4a>
		return (must_exist ? r : 0);
  801024:	89 f8                	mov    %edi,%eax
  801026:	84 c0                	test   %al,%al
  801028:	b8 00 00 00 00       	mov    $0x0,%eax
  80102d:	0f 44 d8             	cmove  %eax,%ebx
}
  801030:	89 d8                	mov    %ebx,%eax
  801032:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801035:	5b                   	pop    %ebx
  801036:	5e                   	pop    %esi
  801037:	5f                   	pop    %edi
  801038:	5d                   	pop    %ebp
  801039:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  80103a:	83 ec 08             	sub    $0x8,%esp
  80103d:	8d 45 e0             	lea    -0x20(%ebp),%eax
  801040:	50                   	push   %eax
  801041:	ff 36                	pushl  (%esi)
  801043:	e8 4e ff ff ff       	call   800f96 <dev_lookup>
  801048:	89 c3                	mov    %eax,%ebx
  80104a:	83 c4 10             	add    $0x10,%esp
  80104d:	85 c0                	test   %eax,%eax
  80104f:	78 1a                	js     80106b <fd_close+0x7b>
		if (dev->dev_close)
  801051:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801054:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  801057:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  80105c:	85 c0                	test   %eax,%eax
  80105e:	74 0b                	je     80106b <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  801060:	83 ec 0c             	sub    $0xc,%esp
  801063:	56                   	push   %esi
  801064:	ff d0                	call   *%eax
  801066:	89 c3                	mov    %eax,%ebx
  801068:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  80106b:	83 ec 08             	sub    $0x8,%esp
  80106e:	56                   	push   %esi
  80106f:	6a 00                	push   $0x0
  801071:	e8 c3 fc ff ff       	call   800d39 <sys_page_unmap>
	return r;
  801076:	83 c4 10             	add    $0x10,%esp
  801079:	eb b5                	jmp    801030 <fd_close+0x40>

0080107b <close>:

int
close(int fdnum)
{
  80107b:	f3 0f 1e fb          	endbr32 
  80107f:	55                   	push   %ebp
  801080:	89 e5                	mov    %esp,%ebp
  801082:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801085:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801088:	50                   	push   %eax
  801089:	ff 75 08             	pushl  0x8(%ebp)
  80108c:	e8 b1 fe ff ff       	call   800f42 <fd_lookup>
  801091:	83 c4 10             	add    $0x10,%esp
  801094:	85 c0                	test   %eax,%eax
  801096:	79 02                	jns    80109a <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  801098:	c9                   	leave  
  801099:	c3                   	ret    
		return fd_close(fd, 1);
  80109a:	83 ec 08             	sub    $0x8,%esp
  80109d:	6a 01                	push   $0x1
  80109f:	ff 75 f4             	pushl  -0xc(%ebp)
  8010a2:	e8 49 ff ff ff       	call   800ff0 <fd_close>
  8010a7:	83 c4 10             	add    $0x10,%esp
  8010aa:	eb ec                	jmp    801098 <close+0x1d>

008010ac <close_all>:

void
close_all(void)
{
  8010ac:	f3 0f 1e fb          	endbr32 
  8010b0:	55                   	push   %ebp
  8010b1:	89 e5                	mov    %esp,%ebp
  8010b3:	53                   	push   %ebx
  8010b4:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8010b7:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8010bc:	83 ec 0c             	sub    $0xc,%esp
  8010bf:	53                   	push   %ebx
  8010c0:	e8 b6 ff ff ff       	call   80107b <close>
	for (i = 0; i < MAXFD; i++)
  8010c5:	83 c3 01             	add    $0x1,%ebx
  8010c8:	83 c4 10             	add    $0x10,%esp
  8010cb:	83 fb 20             	cmp    $0x20,%ebx
  8010ce:	75 ec                	jne    8010bc <close_all+0x10>
}
  8010d0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8010d3:	c9                   	leave  
  8010d4:	c3                   	ret    

008010d5 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  8010d5:	f3 0f 1e fb          	endbr32 
  8010d9:	55                   	push   %ebp
  8010da:	89 e5                	mov    %esp,%ebp
  8010dc:	57                   	push   %edi
  8010dd:	56                   	push   %esi
  8010de:	53                   	push   %ebx
  8010df:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  8010e2:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8010e5:	50                   	push   %eax
  8010e6:	ff 75 08             	pushl  0x8(%ebp)
  8010e9:	e8 54 fe ff ff       	call   800f42 <fd_lookup>
  8010ee:	89 c3                	mov    %eax,%ebx
  8010f0:	83 c4 10             	add    $0x10,%esp
  8010f3:	85 c0                	test   %eax,%eax
  8010f5:	0f 88 81 00 00 00    	js     80117c <dup+0xa7>
		return r;
	close(newfdnum);
  8010fb:	83 ec 0c             	sub    $0xc,%esp
  8010fe:	ff 75 0c             	pushl  0xc(%ebp)
  801101:	e8 75 ff ff ff       	call   80107b <close>

	newfd = INDEX2FD(newfdnum);
  801106:	8b 75 0c             	mov    0xc(%ebp),%esi
  801109:	c1 e6 0c             	shl    $0xc,%esi
  80110c:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  801112:	83 c4 04             	add    $0x4,%esp
  801115:	ff 75 e4             	pushl  -0x1c(%ebp)
  801118:	e8 b4 fd ff ff       	call   800ed1 <fd2data>
  80111d:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  80111f:	89 34 24             	mov    %esi,(%esp)
  801122:	e8 aa fd ff ff       	call   800ed1 <fd2data>
  801127:	83 c4 10             	add    $0x10,%esp
  80112a:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  80112c:	89 d8                	mov    %ebx,%eax
  80112e:	c1 e8 16             	shr    $0x16,%eax
  801131:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801138:	a8 01                	test   $0x1,%al
  80113a:	74 11                	je     80114d <dup+0x78>
  80113c:	89 d8                	mov    %ebx,%eax
  80113e:	c1 e8 0c             	shr    $0xc,%eax
  801141:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801148:	f6 c2 01             	test   $0x1,%dl
  80114b:	75 39                	jne    801186 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80114d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801150:	89 d0                	mov    %edx,%eax
  801152:	c1 e8 0c             	shr    $0xc,%eax
  801155:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80115c:	83 ec 0c             	sub    $0xc,%esp
  80115f:	25 07 0e 00 00       	and    $0xe07,%eax
  801164:	50                   	push   %eax
  801165:	56                   	push   %esi
  801166:	6a 00                	push   $0x0
  801168:	52                   	push   %edx
  801169:	6a 00                	push   $0x0
  80116b:	e8 83 fb ff ff       	call   800cf3 <sys_page_map>
  801170:	89 c3                	mov    %eax,%ebx
  801172:	83 c4 20             	add    $0x20,%esp
  801175:	85 c0                	test   %eax,%eax
  801177:	78 31                	js     8011aa <dup+0xd5>
		goto err;

	return newfdnum;
  801179:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  80117c:	89 d8                	mov    %ebx,%eax
  80117e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801181:	5b                   	pop    %ebx
  801182:	5e                   	pop    %esi
  801183:	5f                   	pop    %edi
  801184:	5d                   	pop    %ebp
  801185:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801186:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80118d:	83 ec 0c             	sub    $0xc,%esp
  801190:	25 07 0e 00 00       	and    $0xe07,%eax
  801195:	50                   	push   %eax
  801196:	57                   	push   %edi
  801197:	6a 00                	push   $0x0
  801199:	53                   	push   %ebx
  80119a:	6a 00                	push   $0x0
  80119c:	e8 52 fb ff ff       	call   800cf3 <sys_page_map>
  8011a1:	89 c3                	mov    %eax,%ebx
  8011a3:	83 c4 20             	add    $0x20,%esp
  8011a6:	85 c0                	test   %eax,%eax
  8011a8:	79 a3                	jns    80114d <dup+0x78>
	sys_page_unmap(0, newfd);
  8011aa:	83 ec 08             	sub    $0x8,%esp
  8011ad:	56                   	push   %esi
  8011ae:	6a 00                	push   $0x0
  8011b0:	e8 84 fb ff ff       	call   800d39 <sys_page_unmap>
	sys_page_unmap(0, nva);
  8011b5:	83 c4 08             	add    $0x8,%esp
  8011b8:	57                   	push   %edi
  8011b9:	6a 00                	push   $0x0
  8011bb:	e8 79 fb ff ff       	call   800d39 <sys_page_unmap>
	return r;
  8011c0:	83 c4 10             	add    $0x10,%esp
  8011c3:	eb b7                	jmp    80117c <dup+0xa7>

008011c5 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8011c5:	f3 0f 1e fb          	endbr32 
  8011c9:	55                   	push   %ebp
  8011ca:	89 e5                	mov    %esp,%ebp
  8011cc:	53                   	push   %ebx
  8011cd:	83 ec 1c             	sub    $0x1c,%esp
  8011d0:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8011d3:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8011d6:	50                   	push   %eax
  8011d7:	53                   	push   %ebx
  8011d8:	e8 65 fd ff ff       	call   800f42 <fd_lookup>
  8011dd:	83 c4 10             	add    $0x10,%esp
  8011e0:	85 c0                	test   %eax,%eax
  8011e2:	78 3f                	js     801223 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8011e4:	83 ec 08             	sub    $0x8,%esp
  8011e7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011ea:	50                   	push   %eax
  8011eb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011ee:	ff 30                	pushl  (%eax)
  8011f0:	e8 a1 fd ff ff       	call   800f96 <dev_lookup>
  8011f5:	83 c4 10             	add    $0x10,%esp
  8011f8:	85 c0                	test   %eax,%eax
  8011fa:	78 27                	js     801223 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8011fc:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8011ff:	8b 42 08             	mov    0x8(%edx),%eax
  801202:	83 e0 03             	and    $0x3,%eax
  801205:	83 f8 01             	cmp    $0x1,%eax
  801208:	74 1e                	je     801228 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  80120a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80120d:	8b 40 08             	mov    0x8(%eax),%eax
  801210:	85 c0                	test   %eax,%eax
  801212:	74 35                	je     801249 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  801214:	83 ec 04             	sub    $0x4,%esp
  801217:	ff 75 10             	pushl  0x10(%ebp)
  80121a:	ff 75 0c             	pushl  0xc(%ebp)
  80121d:	52                   	push   %edx
  80121e:	ff d0                	call   *%eax
  801220:	83 c4 10             	add    $0x10,%esp
}
  801223:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801226:	c9                   	leave  
  801227:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801228:	a1 04 40 80 00       	mov    0x804004,%eax
  80122d:	8b 40 48             	mov    0x48(%eax),%eax
  801230:	83 ec 04             	sub    $0x4,%esp
  801233:	53                   	push   %ebx
  801234:	50                   	push   %eax
  801235:	68 4d 2a 80 00       	push   $0x802a4d
  80123a:	e8 52 f0 ff ff       	call   800291 <cprintf>
		return -E_INVAL;
  80123f:	83 c4 10             	add    $0x10,%esp
  801242:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801247:	eb da                	jmp    801223 <read+0x5e>
		return -E_NOT_SUPP;
  801249:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80124e:	eb d3                	jmp    801223 <read+0x5e>

00801250 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801250:	f3 0f 1e fb          	endbr32 
  801254:	55                   	push   %ebp
  801255:	89 e5                	mov    %esp,%ebp
  801257:	57                   	push   %edi
  801258:	56                   	push   %esi
  801259:	53                   	push   %ebx
  80125a:	83 ec 0c             	sub    $0xc,%esp
  80125d:	8b 7d 08             	mov    0x8(%ebp),%edi
  801260:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801263:	bb 00 00 00 00       	mov    $0x0,%ebx
  801268:	eb 02                	jmp    80126c <readn+0x1c>
  80126a:	01 c3                	add    %eax,%ebx
  80126c:	39 f3                	cmp    %esi,%ebx
  80126e:	73 21                	jae    801291 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801270:	83 ec 04             	sub    $0x4,%esp
  801273:	89 f0                	mov    %esi,%eax
  801275:	29 d8                	sub    %ebx,%eax
  801277:	50                   	push   %eax
  801278:	89 d8                	mov    %ebx,%eax
  80127a:	03 45 0c             	add    0xc(%ebp),%eax
  80127d:	50                   	push   %eax
  80127e:	57                   	push   %edi
  80127f:	e8 41 ff ff ff       	call   8011c5 <read>
		if (m < 0)
  801284:	83 c4 10             	add    $0x10,%esp
  801287:	85 c0                	test   %eax,%eax
  801289:	78 04                	js     80128f <readn+0x3f>
			return m;
		if (m == 0)
  80128b:	75 dd                	jne    80126a <readn+0x1a>
  80128d:	eb 02                	jmp    801291 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  80128f:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801291:	89 d8                	mov    %ebx,%eax
  801293:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801296:	5b                   	pop    %ebx
  801297:	5e                   	pop    %esi
  801298:	5f                   	pop    %edi
  801299:	5d                   	pop    %ebp
  80129a:	c3                   	ret    

0080129b <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  80129b:	f3 0f 1e fb          	endbr32 
  80129f:	55                   	push   %ebp
  8012a0:	89 e5                	mov    %esp,%ebp
  8012a2:	53                   	push   %ebx
  8012a3:	83 ec 1c             	sub    $0x1c,%esp
  8012a6:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012a9:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012ac:	50                   	push   %eax
  8012ad:	53                   	push   %ebx
  8012ae:	e8 8f fc ff ff       	call   800f42 <fd_lookup>
  8012b3:	83 c4 10             	add    $0x10,%esp
  8012b6:	85 c0                	test   %eax,%eax
  8012b8:	78 3a                	js     8012f4 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012ba:	83 ec 08             	sub    $0x8,%esp
  8012bd:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012c0:	50                   	push   %eax
  8012c1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012c4:	ff 30                	pushl  (%eax)
  8012c6:	e8 cb fc ff ff       	call   800f96 <dev_lookup>
  8012cb:	83 c4 10             	add    $0x10,%esp
  8012ce:	85 c0                	test   %eax,%eax
  8012d0:	78 22                	js     8012f4 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8012d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012d5:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8012d9:	74 1e                	je     8012f9 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8012db:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8012de:	8b 52 0c             	mov    0xc(%edx),%edx
  8012e1:	85 d2                	test   %edx,%edx
  8012e3:	74 35                	je     80131a <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8012e5:	83 ec 04             	sub    $0x4,%esp
  8012e8:	ff 75 10             	pushl  0x10(%ebp)
  8012eb:	ff 75 0c             	pushl  0xc(%ebp)
  8012ee:	50                   	push   %eax
  8012ef:	ff d2                	call   *%edx
  8012f1:	83 c4 10             	add    $0x10,%esp
}
  8012f4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8012f7:	c9                   	leave  
  8012f8:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8012f9:	a1 04 40 80 00       	mov    0x804004,%eax
  8012fe:	8b 40 48             	mov    0x48(%eax),%eax
  801301:	83 ec 04             	sub    $0x4,%esp
  801304:	53                   	push   %ebx
  801305:	50                   	push   %eax
  801306:	68 69 2a 80 00       	push   $0x802a69
  80130b:	e8 81 ef ff ff       	call   800291 <cprintf>
		return -E_INVAL;
  801310:	83 c4 10             	add    $0x10,%esp
  801313:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801318:	eb da                	jmp    8012f4 <write+0x59>
		return -E_NOT_SUPP;
  80131a:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80131f:	eb d3                	jmp    8012f4 <write+0x59>

00801321 <seek>:

int
seek(int fdnum, off_t offset)
{
  801321:	f3 0f 1e fb          	endbr32 
  801325:	55                   	push   %ebp
  801326:	89 e5                	mov    %esp,%ebp
  801328:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80132b:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80132e:	50                   	push   %eax
  80132f:	ff 75 08             	pushl  0x8(%ebp)
  801332:	e8 0b fc ff ff       	call   800f42 <fd_lookup>
  801337:	83 c4 10             	add    $0x10,%esp
  80133a:	85 c0                	test   %eax,%eax
  80133c:	78 0e                	js     80134c <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80133e:	8b 55 0c             	mov    0xc(%ebp),%edx
  801341:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801344:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801347:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80134c:	c9                   	leave  
  80134d:	c3                   	ret    

0080134e <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80134e:	f3 0f 1e fb          	endbr32 
  801352:	55                   	push   %ebp
  801353:	89 e5                	mov    %esp,%ebp
  801355:	53                   	push   %ebx
  801356:	83 ec 1c             	sub    $0x1c,%esp
  801359:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  80135c:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80135f:	50                   	push   %eax
  801360:	53                   	push   %ebx
  801361:	e8 dc fb ff ff       	call   800f42 <fd_lookup>
  801366:	83 c4 10             	add    $0x10,%esp
  801369:	85 c0                	test   %eax,%eax
  80136b:	78 37                	js     8013a4 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80136d:	83 ec 08             	sub    $0x8,%esp
  801370:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801373:	50                   	push   %eax
  801374:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801377:	ff 30                	pushl  (%eax)
  801379:	e8 18 fc ff ff       	call   800f96 <dev_lookup>
  80137e:	83 c4 10             	add    $0x10,%esp
  801381:	85 c0                	test   %eax,%eax
  801383:	78 1f                	js     8013a4 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801385:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801388:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  80138c:	74 1b                	je     8013a9 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  80138e:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801391:	8b 52 18             	mov    0x18(%edx),%edx
  801394:	85 d2                	test   %edx,%edx
  801396:	74 32                	je     8013ca <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801398:	83 ec 08             	sub    $0x8,%esp
  80139b:	ff 75 0c             	pushl  0xc(%ebp)
  80139e:	50                   	push   %eax
  80139f:	ff d2                	call   *%edx
  8013a1:	83 c4 10             	add    $0x10,%esp
}
  8013a4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8013a7:	c9                   	leave  
  8013a8:	c3                   	ret    
			thisenv->env_id, fdnum);
  8013a9:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8013ae:	8b 40 48             	mov    0x48(%eax),%eax
  8013b1:	83 ec 04             	sub    $0x4,%esp
  8013b4:	53                   	push   %ebx
  8013b5:	50                   	push   %eax
  8013b6:	68 2c 2a 80 00       	push   $0x802a2c
  8013bb:	e8 d1 ee ff ff       	call   800291 <cprintf>
		return -E_INVAL;
  8013c0:	83 c4 10             	add    $0x10,%esp
  8013c3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8013c8:	eb da                	jmp    8013a4 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8013ca:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8013cf:	eb d3                	jmp    8013a4 <ftruncate+0x56>

008013d1 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8013d1:	f3 0f 1e fb          	endbr32 
  8013d5:	55                   	push   %ebp
  8013d6:	89 e5                	mov    %esp,%ebp
  8013d8:	53                   	push   %ebx
  8013d9:	83 ec 1c             	sub    $0x1c,%esp
  8013dc:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8013df:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8013e2:	50                   	push   %eax
  8013e3:	ff 75 08             	pushl  0x8(%ebp)
  8013e6:	e8 57 fb ff ff       	call   800f42 <fd_lookup>
  8013eb:	83 c4 10             	add    $0x10,%esp
  8013ee:	85 c0                	test   %eax,%eax
  8013f0:	78 4b                	js     80143d <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8013f2:	83 ec 08             	sub    $0x8,%esp
  8013f5:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8013f8:	50                   	push   %eax
  8013f9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013fc:	ff 30                	pushl  (%eax)
  8013fe:	e8 93 fb ff ff       	call   800f96 <dev_lookup>
  801403:	83 c4 10             	add    $0x10,%esp
  801406:	85 c0                	test   %eax,%eax
  801408:	78 33                	js     80143d <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  80140a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80140d:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  801411:	74 2f                	je     801442 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  801413:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  801416:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  80141d:	00 00 00 
	stat->st_isdir = 0;
  801420:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801427:	00 00 00 
	stat->st_dev = dev;
  80142a:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801430:	83 ec 08             	sub    $0x8,%esp
  801433:	53                   	push   %ebx
  801434:	ff 75 f0             	pushl  -0x10(%ebp)
  801437:	ff 50 14             	call   *0x14(%eax)
  80143a:	83 c4 10             	add    $0x10,%esp
}
  80143d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801440:	c9                   	leave  
  801441:	c3                   	ret    
		return -E_NOT_SUPP;
  801442:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801447:	eb f4                	jmp    80143d <fstat+0x6c>

00801449 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801449:	f3 0f 1e fb          	endbr32 
  80144d:	55                   	push   %ebp
  80144e:	89 e5                	mov    %esp,%ebp
  801450:	56                   	push   %esi
  801451:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  801452:	83 ec 08             	sub    $0x8,%esp
  801455:	6a 00                	push   $0x0
  801457:	ff 75 08             	pushl  0x8(%ebp)
  80145a:	e8 fb 01 00 00       	call   80165a <open>
  80145f:	89 c3                	mov    %eax,%ebx
  801461:	83 c4 10             	add    $0x10,%esp
  801464:	85 c0                	test   %eax,%eax
  801466:	78 1b                	js     801483 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801468:	83 ec 08             	sub    $0x8,%esp
  80146b:	ff 75 0c             	pushl  0xc(%ebp)
  80146e:	50                   	push   %eax
  80146f:	e8 5d ff ff ff       	call   8013d1 <fstat>
  801474:	89 c6                	mov    %eax,%esi
	close(fd);
  801476:	89 1c 24             	mov    %ebx,(%esp)
  801479:	e8 fd fb ff ff       	call   80107b <close>
	return r;
  80147e:	83 c4 10             	add    $0x10,%esp
  801481:	89 f3                	mov    %esi,%ebx
}
  801483:	89 d8                	mov    %ebx,%eax
  801485:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801488:	5b                   	pop    %ebx
  801489:	5e                   	pop    %esi
  80148a:	5d                   	pop    %ebp
  80148b:	c3                   	ret    

0080148c <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  80148c:	55                   	push   %ebp
  80148d:	89 e5                	mov    %esp,%ebp
  80148f:	56                   	push   %esi
  801490:	53                   	push   %ebx
  801491:	89 c6                	mov    %eax,%esi
  801493:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801495:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  80149c:	74 27                	je     8014c5 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  80149e:	6a 07                	push   $0x7
  8014a0:	68 00 50 80 00       	push   $0x805000
  8014a5:	56                   	push   %esi
  8014a6:	ff 35 00 40 80 00    	pushl  0x804000
  8014ac:	e8 de 0d 00 00       	call   80228f <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8014b1:	83 c4 0c             	add    $0xc,%esp
  8014b4:	6a 00                	push   $0x0
  8014b6:	53                   	push   %ebx
  8014b7:	6a 00                	push   $0x0
  8014b9:	e8 50 0d 00 00       	call   80220e <ipc_recv>
}
  8014be:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014c1:	5b                   	pop    %ebx
  8014c2:	5e                   	pop    %esi
  8014c3:	5d                   	pop    %ebp
  8014c4:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8014c5:	83 ec 0c             	sub    $0xc,%esp
  8014c8:	6a 01                	push   $0x1
  8014ca:	e8 18 0e 00 00       	call   8022e7 <ipc_find_env>
  8014cf:	a3 00 40 80 00       	mov    %eax,0x804000
  8014d4:	83 c4 10             	add    $0x10,%esp
  8014d7:	eb c5                	jmp    80149e <fsipc+0x12>

008014d9 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8014d9:	f3 0f 1e fb          	endbr32 
  8014dd:	55                   	push   %ebp
  8014de:	89 e5                	mov    %esp,%ebp
  8014e0:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8014e3:	8b 45 08             	mov    0x8(%ebp),%eax
  8014e6:	8b 40 0c             	mov    0xc(%eax),%eax
  8014e9:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  8014ee:	8b 45 0c             	mov    0xc(%ebp),%eax
  8014f1:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8014f6:	ba 00 00 00 00       	mov    $0x0,%edx
  8014fb:	b8 02 00 00 00       	mov    $0x2,%eax
  801500:	e8 87 ff ff ff       	call   80148c <fsipc>
}
  801505:	c9                   	leave  
  801506:	c3                   	ret    

00801507 <devfile_flush>:
{
  801507:	f3 0f 1e fb          	endbr32 
  80150b:	55                   	push   %ebp
  80150c:	89 e5                	mov    %esp,%ebp
  80150e:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  801511:	8b 45 08             	mov    0x8(%ebp),%eax
  801514:	8b 40 0c             	mov    0xc(%eax),%eax
  801517:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  80151c:	ba 00 00 00 00       	mov    $0x0,%edx
  801521:	b8 06 00 00 00       	mov    $0x6,%eax
  801526:	e8 61 ff ff ff       	call   80148c <fsipc>
}
  80152b:	c9                   	leave  
  80152c:	c3                   	ret    

0080152d <devfile_stat>:
{
  80152d:	f3 0f 1e fb          	endbr32 
  801531:	55                   	push   %ebp
  801532:	89 e5                	mov    %esp,%ebp
  801534:	53                   	push   %ebx
  801535:	83 ec 04             	sub    $0x4,%esp
  801538:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  80153b:	8b 45 08             	mov    0x8(%ebp),%eax
  80153e:	8b 40 0c             	mov    0xc(%eax),%eax
  801541:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801546:	ba 00 00 00 00       	mov    $0x0,%edx
  80154b:	b8 05 00 00 00       	mov    $0x5,%eax
  801550:	e8 37 ff ff ff       	call   80148c <fsipc>
  801555:	85 c0                	test   %eax,%eax
  801557:	78 2c                	js     801585 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801559:	83 ec 08             	sub    $0x8,%esp
  80155c:	68 00 50 80 00       	push   $0x805000
  801561:	53                   	push   %ebx
  801562:	e8 03 f3 ff ff       	call   80086a <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801567:	a1 80 50 80 00       	mov    0x805080,%eax
  80156c:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  801572:	a1 84 50 80 00       	mov    0x805084,%eax
  801577:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80157d:	83 c4 10             	add    $0x10,%esp
  801580:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801585:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801588:	c9                   	leave  
  801589:	c3                   	ret    

0080158a <devfile_write>:
{
  80158a:	f3 0f 1e fb          	endbr32 
  80158e:	55                   	push   %ebp
  80158f:	89 e5                	mov    %esp,%ebp
  801591:	83 ec 0c             	sub    $0xc,%esp
  801594:	8b 45 10             	mov    0x10(%ebp),%eax
  801597:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  80159c:	ba f8 0f 00 00       	mov    $0xff8,%edx
  8015a1:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  8015a4:	8b 55 08             	mov    0x8(%ebp),%edx
  8015a7:	8b 52 0c             	mov    0xc(%edx),%edx
  8015aa:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  8015b0:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8015b5:	50                   	push   %eax
  8015b6:	ff 75 0c             	pushl  0xc(%ebp)
  8015b9:	68 08 50 80 00       	push   $0x805008
  8015be:	e8 5d f4 ff ff       	call   800a20 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8015c3:	ba 00 00 00 00       	mov    $0x0,%edx
  8015c8:	b8 04 00 00 00       	mov    $0x4,%eax
  8015cd:	e8 ba fe ff ff       	call   80148c <fsipc>
  8015d2:	c9                   	leave  
  8015d3:	c3                   	ret    

008015d4 <devfile_read>:
{
  8015d4:	f3 0f 1e fb          	endbr32 
  8015d8:	55                   	push   %ebp
  8015d9:	89 e5                	mov    %esp,%ebp
  8015db:	56                   	push   %esi
  8015dc:	53                   	push   %ebx
  8015dd:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8015e0:	8b 45 08             	mov    0x8(%ebp),%eax
  8015e3:	8b 40 0c             	mov    0xc(%eax),%eax
  8015e6:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  8015eb:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8015f1:	ba 00 00 00 00       	mov    $0x0,%edx
  8015f6:	b8 03 00 00 00       	mov    $0x3,%eax
  8015fb:	e8 8c fe ff ff       	call   80148c <fsipc>
  801600:	89 c3                	mov    %eax,%ebx
  801602:	85 c0                	test   %eax,%eax
  801604:	78 1f                	js     801625 <devfile_read+0x51>
	assert(r <= n);
  801606:	39 f0                	cmp    %esi,%eax
  801608:	77 24                	ja     80162e <devfile_read+0x5a>
	assert(r <= PGSIZE);
  80160a:	3d 00 10 00 00       	cmp    $0x1000,%eax
  80160f:	7f 33                	jg     801644 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  801611:	83 ec 04             	sub    $0x4,%esp
  801614:	50                   	push   %eax
  801615:	68 00 50 80 00       	push   $0x805000
  80161a:	ff 75 0c             	pushl  0xc(%ebp)
  80161d:	e8 fe f3 ff ff       	call   800a20 <memmove>
	return r;
  801622:	83 c4 10             	add    $0x10,%esp
}
  801625:	89 d8                	mov    %ebx,%eax
  801627:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80162a:	5b                   	pop    %ebx
  80162b:	5e                   	pop    %esi
  80162c:	5d                   	pop    %ebp
  80162d:	c3                   	ret    
	assert(r <= n);
  80162e:	68 98 2a 80 00       	push   $0x802a98
  801633:	68 9f 2a 80 00       	push   $0x802a9f
  801638:	6a 7c                	push   $0x7c
  80163a:	68 b4 2a 80 00       	push   $0x802ab4
  80163f:	e8 66 eb ff ff       	call   8001aa <_panic>
	assert(r <= PGSIZE);
  801644:	68 bf 2a 80 00       	push   $0x802abf
  801649:	68 9f 2a 80 00       	push   $0x802a9f
  80164e:	6a 7d                	push   $0x7d
  801650:	68 b4 2a 80 00       	push   $0x802ab4
  801655:	e8 50 eb ff ff       	call   8001aa <_panic>

0080165a <open>:
{
  80165a:	f3 0f 1e fb          	endbr32 
  80165e:	55                   	push   %ebp
  80165f:	89 e5                	mov    %esp,%ebp
  801661:	56                   	push   %esi
  801662:	53                   	push   %ebx
  801663:	83 ec 1c             	sub    $0x1c,%esp
  801666:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  801669:	56                   	push   %esi
  80166a:	e8 b8 f1 ff ff       	call   800827 <strlen>
  80166f:	83 c4 10             	add    $0x10,%esp
  801672:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801677:	7f 6c                	jg     8016e5 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801679:	83 ec 0c             	sub    $0xc,%esp
  80167c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80167f:	50                   	push   %eax
  801680:	e8 67 f8 ff ff       	call   800eec <fd_alloc>
  801685:	89 c3                	mov    %eax,%ebx
  801687:	83 c4 10             	add    $0x10,%esp
  80168a:	85 c0                	test   %eax,%eax
  80168c:	78 3c                	js     8016ca <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  80168e:	83 ec 08             	sub    $0x8,%esp
  801691:	56                   	push   %esi
  801692:	68 00 50 80 00       	push   $0x805000
  801697:	e8 ce f1 ff ff       	call   80086a <strcpy>
	fsipcbuf.open.req_omode = mode;
  80169c:	8b 45 0c             	mov    0xc(%ebp),%eax
  80169f:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  8016a4:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8016a7:	b8 01 00 00 00       	mov    $0x1,%eax
  8016ac:	e8 db fd ff ff       	call   80148c <fsipc>
  8016b1:	89 c3                	mov    %eax,%ebx
  8016b3:	83 c4 10             	add    $0x10,%esp
  8016b6:	85 c0                	test   %eax,%eax
  8016b8:	78 19                	js     8016d3 <open+0x79>
	return fd2num(fd);
  8016ba:	83 ec 0c             	sub    $0xc,%esp
  8016bd:	ff 75 f4             	pushl  -0xc(%ebp)
  8016c0:	e8 f8 f7 ff ff       	call   800ebd <fd2num>
  8016c5:	89 c3                	mov    %eax,%ebx
  8016c7:	83 c4 10             	add    $0x10,%esp
}
  8016ca:	89 d8                	mov    %ebx,%eax
  8016cc:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8016cf:	5b                   	pop    %ebx
  8016d0:	5e                   	pop    %esi
  8016d1:	5d                   	pop    %ebp
  8016d2:	c3                   	ret    
		fd_close(fd, 0);
  8016d3:	83 ec 08             	sub    $0x8,%esp
  8016d6:	6a 00                	push   $0x0
  8016d8:	ff 75 f4             	pushl  -0xc(%ebp)
  8016db:	e8 10 f9 ff ff       	call   800ff0 <fd_close>
		return r;
  8016e0:	83 c4 10             	add    $0x10,%esp
  8016e3:	eb e5                	jmp    8016ca <open+0x70>
		return -E_BAD_PATH;
  8016e5:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8016ea:	eb de                	jmp    8016ca <open+0x70>

008016ec <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8016ec:	f3 0f 1e fb          	endbr32 
  8016f0:	55                   	push   %ebp
  8016f1:	89 e5                	mov    %esp,%ebp
  8016f3:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8016f6:	ba 00 00 00 00       	mov    $0x0,%edx
  8016fb:	b8 08 00 00 00       	mov    $0x8,%eax
  801700:	e8 87 fd ff ff       	call   80148c <fsipc>
}
  801705:	c9                   	leave  
  801706:	c3                   	ret    

00801707 <spawn>:
// argv: pointer to null-terminated array of pointers to strings,
// 	 which will be passed to the child as its command-line arguments.
// Returns child envid on success, < 0 on failure.
int
spawn(const char *prog, const char **argv)
{
  801707:	f3 0f 1e fb          	endbr32 
  80170b:	55                   	push   %ebp
  80170c:	89 e5                	mov    %esp,%ebp
  80170e:	57                   	push   %edi
  80170f:	56                   	push   %esi
  801710:	53                   	push   %ebx
  801711:	81 ec 94 02 00 00    	sub    $0x294,%esp
	//   - Call sys_env_set_trapframe(child, &child_tf) to set up the
	//     correct initial eip and esp values in the child.
	//
	//   - Start the child process running with sys_env_set_status().

	if ((r = open(prog, O_RDONLY)) < 0)
  801717:	6a 00                	push   $0x0
  801719:	ff 75 08             	pushl  0x8(%ebp)
  80171c:	e8 39 ff ff ff       	call   80165a <open>
  801721:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
  801727:	83 c4 10             	add    $0x10,%esp
  80172a:	85 c0                	test   %eax,%eax
  80172c:	0f 88 e5 04 00 00    	js     801c17 <spawn+0x510>
  801732:	89 c1                	mov    %eax,%ecx
		return r;
	fd = r;

	// Read elf header
	elf = (struct Elf*) elf_buf;
	if (readn(fd, elf_buf, sizeof(elf_buf)) != sizeof(elf_buf)
  801734:	83 ec 04             	sub    $0x4,%esp
  801737:	68 00 02 00 00       	push   $0x200
  80173c:	8d 85 e8 fd ff ff    	lea    -0x218(%ebp),%eax
  801742:	50                   	push   %eax
  801743:	51                   	push   %ecx
  801744:	e8 07 fb ff ff       	call   801250 <readn>
  801749:	83 c4 10             	add    $0x10,%esp
  80174c:	3d 00 02 00 00       	cmp    $0x200,%eax
  801751:	75 7e                	jne    8017d1 <spawn+0xca>
	    || elf->e_magic != ELF_MAGIC) {
  801753:	81 bd e8 fd ff ff 7f 	cmpl   $0x464c457f,-0x218(%ebp)
  80175a:	45 4c 46 
  80175d:	75 72                	jne    8017d1 <spawn+0xca>
// This must be inlined.  Exercise for reader: why?
static inline envid_t __attribute__((always_inline))
sys_exofork(void)
{
	envid_t ret;
	asm volatile("int %2"
  80175f:	b8 07 00 00 00       	mov    $0x7,%eax
  801764:	cd 30                	int    $0x30
  801766:	89 85 74 fd ff ff    	mov    %eax,-0x28c(%ebp)
  80176c:	89 85 88 fd ff ff    	mov    %eax,-0x278(%ebp)
		cprintf("elf magic %08x want %08x\n", elf->e_magic, ELF_MAGIC);
		return -E_NOT_EXEC;
	}

	// Create new child environment
	if ((r = sys_exofork()) < 0)
  801772:	85 c0                	test   %eax,%eax
  801774:	0f 88 91 04 00 00    	js     801c0b <spawn+0x504>
		return r;
	child = r;

	// Set up trap frame, including initial stack.
	child_tf = envs[ENVX(child)].env_tf;
  80177a:	25 ff 03 00 00       	and    $0x3ff,%eax
  80177f:	6b f0 7c             	imul   $0x7c,%eax,%esi
  801782:	81 c6 00 00 c0 ee    	add    $0xeec00000,%esi
  801788:	8d bd a4 fd ff ff    	lea    -0x25c(%ebp),%edi
  80178e:	b9 11 00 00 00       	mov    $0x11,%ecx
  801793:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
	child_tf.tf_eip = elf->e_entry;
  801795:	8b 85 00 fe ff ff    	mov    -0x200(%ebp),%eax
  80179b:	89 85 d4 fd ff ff    	mov    %eax,-0x22c(%ebp)
	uintptr_t *argv_store;

	// Count the number of arguments (argc)
	// and the total amount of space needed for strings (string_size).
	string_size = 0;
	for (argc = 0; argv[argc] != 0; argc++)
  8017a1:	bb 00 00 00 00       	mov    $0x0,%ebx
	string_size = 0;
  8017a6:	be 00 00 00 00       	mov    $0x0,%esi
  8017ab:	8b 7d 0c             	mov    0xc(%ebp),%edi
  8017ae:	8d 0c 9d 00 00 00 00 	lea    0x0(,%ebx,4),%ecx
	for (argc = 0; argv[argc] != 0; argc++)
  8017b5:	8b 04 9f             	mov    (%edi,%ebx,4),%eax
  8017b8:	85 c0                	test   %eax,%eax
  8017ba:	74 4d                	je     801809 <spawn+0x102>
		string_size += strlen(argv[argc]) + 1;
  8017bc:	83 ec 0c             	sub    $0xc,%esp
  8017bf:	50                   	push   %eax
  8017c0:	e8 62 f0 ff ff       	call   800827 <strlen>
  8017c5:	8d 74 06 01          	lea    0x1(%esi,%eax,1),%esi
	for (argc = 0; argv[argc] != 0; argc++)
  8017c9:	83 c3 01             	add    $0x1,%ebx
  8017cc:	83 c4 10             	add    $0x10,%esp
  8017cf:	eb dd                	jmp    8017ae <spawn+0xa7>
		close(fd);
  8017d1:	83 ec 0c             	sub    $0xc,%esp
  8017d4:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  8017da:	e8 9c f8 ff ff       	call   80107b <close>
		cprintf("elf magic %08x want %08x\n", elf->e_magic, ELF_MAGIC);
  8017df:	83 c4 0c             	add    $0xc,%esp
  8017e2:	68 7f 45 4c 46       	push   $0x464c457f
  8017e7:	ff b5 e8 fd ff ff    	pushl  -0x218(%ebp)
  8017ed:	68 cb 2a 80 00       	push   $0x802acb
  8017f2:	e8 9a ea ff ff       	call   800291 <cprintf>
		return -E_NOT_EXEC;
  8017f7:	83 c4 10             	add    $0x10,%esp
  8017fa:	c7 85 94 fd ff ff f2 	movl   $0xfffffff2,-0x26c(%ebp)
  801801:	ff ff ff 
  801804:	e9 0e 04 00 00       	jmp    801c17 <spawn+0x510>
  801809:	89 9d 84 fd ff ff    	mov    %ebx,-0x27c(%ebp)
  80180f:	89 8d 80 fd ff ff    	mov    %ecx,-0x280(%ebp)
	// Determine where to place the strings and the argv array.
	// Set up pointers into the temporary page 'UTEMP'; we'll map a page
	// there later, then remap that page into the child environment
	// at (USTACKTOP - PGSIZE).
	// strings is the topmost thing on the stack.
	string_store = (char*) UTEMP + PGSIZE - string_size;
  801815:	bf 00 10 40 00       	mov    $0x401000,%edi
  80181a:	29 f7                	sub    %esi,%edi
	// argv is below that.  There's one argument pointer per argument, plus
	// a null pointer.
	argv_store = (uintptr_t*) (ROUNDDOWN(string_store, 4) - 4 * (argc + 1));
  80181c:	89 fa                	mov    %edi,%edx
  80181e:	83 e2 fc             	and    $0xfffffffc,%edx
  801821:	8d 04 9d 04 00 00 00 	lea    0x4(,%ebx,4),%eax
  801828:	29 c2                	sub    %eax,%edx
  80182a:	89 95 90 fd ff ff    	mov    %edx,-0x270(%ebp)

	// Make sure that argv, strings, and the 2 words that hold 'argc'
	// and 'argv' themselves will all fit in a single stack page.
	if ((void*) (argv_store - 2) < (void*) UTEMP)
  801830:	8d 42 f8             	lea    -0x8(%edx),%eax
  801833:	3d ff ff 3f 00       	cmp    $0x3fffff,%eax
  801838:	0f 86 fc 03 00 00    	jbe    801c3a <spawn+0x533>
		return -E_NO_MEM;

	// Allocate the single stack page at UTEMP.
	if ((r = sys_page_alloc(0, (void*) UTEMP, PTE_P|PTE_U|PTE_W)) < 0)
  80183e:	83 ec 04             	sub    $0x4,%esp
  801841:	6a 07                	push   $0x7
  801843:	68 00 00 40 00       	push   $0x400000
  801848:	6a 00                	push   $0x0
  80184a:	e8 5d f4 ff ff       	call   800cac <sys_page_alloc>
  80184f:	83 c4 10             	add    $0x10,%esp
  801852:	85 c0                	test   %eax,%eax
  801854:	0f 88 e5 03 00 00    	js     801c3f <spawn+0x538>
	//	  (Again, argv should use an address valid in the child's
	//	  environment.)
	//
	//	* Set *init_esp to the initial stack pointer for the child,
	//	  (Again, use an address valid in the child's environment.)
	for (i = 0; i < argc; i++) {
  80185a:	be 00 00 00 00       	mov    $0x0,%esi
  80185f:	89 9d 8c fd ff ff    	mov    %ebx,-0x274(%ebp)
  801865:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  801868:	eb 30                	jmp    80189a <spawn+0x193>
		argv_store[i] = UTEMP2USTACK(string_store);
  80186a:	8d 87 00 d0 7f ee    	lea    -0x11803000(%edi),%eax
  801870:	8b 8d 90 fd ff ff    	mov    -0x270(%ebp),%ecx
  801876:	89 04 b1             	mov    %eax,(%ecx,%esi,4)
		strcpy(string_store, argv[i]);
  801879:	83 ec 08             	sub    $0x8,%esp
  80187c:	ff 34 b3             	pushl  (%ebx,%esi,4)
  80187f:	57                   	push   %edi
  801880:	e8 e5 ef ff ff       	call   80086a <strcpy>
		string_store += strlen(argv[i]) + 1;
  801885:	83 c4 04             	add    $0x4,%esp
  801888:	ff 34 b3             	pushl  (%ebx,%esi,4)
  80188b:	e8 97 ef ff ff       	call   800827 <strlen>
  801890:	8d 7c 07 01          	lea    0x1(%edi,%eax,1),%edi
	for (i = 0; i < argc; i++) {
  801894:	83 c6 01             	add    $0x1,%esi
  801897:	83 c4 10             	add    $0x10,%esp
  80189a:	39 b5 8c fd ff ff    	cmp    %esi,-0x274(%ebp)
  8018a0:	7f c8                	jg     80186a <spawn+0x163>
	}
	argv_store[argc] = 0;
  8018a2:	8b 85 90 fd ff ff    	mov    -0x270(%ebp),%eax
  8018a8:	8b 8d 80 fd ff ff    	mov    -0x280(%ebp),%ecx
  8018ae:	c7 04 08 00 00 00 00 	movl   $0x0,(%eax,%ecx,1)
	assert(string_store == (char*)UTEMP + PGSIZE);
  8018b5:	81 ff 00 10 40 00    	cmp    $0x401000,%edi
  8018bb:	0f 85 86 00 00 00    	jne    801947 <spawn+0x240>

	argv_store[-1] = UTEMP2USTACK(argv_store);
  8018c1:	8b 95 90 fd ff ff    	mov    -0x270(%ebp),%edx
  8018c7:	8d 82 00 d0 7f ee    	lea    -0x11803000(%edx),%eax
  8018cd:	89 42 fc             	mov    %eax,-0x4(%edx)
	argv_store[-2] = argc;
  8018d0:	89 d0                	mov    %edx,%eax
  8018d2:	8b 8d 84 fd ff ff    	mov    -0x27c(%ebp),%ecx
  8018d8:	89 4a f8             	mov    %ecx,-0x8(%edx)

	*init_esp = UTEMP2USTACK(&argv_store[-2]);
  8018db:	2d 08 30 80 11       	sub    $0x11803008,%eax
  8018e0:	89 85 e0 fd ff ff    	mov    %eax,-0x220(%ebp)

	// After completing the stack, map it into the child's address space
	// and unmap it from ours!
	if ((r = sys_page_map(0, UTEMP, child, (void*) (USTACKTOP - PGSIZE), PTE_P | PTE_U | PTE_W)) < 0)
  8018e6:	83 ec 0c             	sub    $0xc,%esp
  8018e9:	6a 07                	push   $0x7
  8018eb:	68 00 d0 bf ee       	push   $0xeebfd000
  8018f0:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  8018f6:	68 00 00 40 00       	push   $0x400000
  8018fb:	6a 00                	push   $0x0
  8018fd:	e8 f1 f3 ff ff       	call   800cf3 <sys_page_map>
  801902:	89 c3                	mov    %eax,%ebx
  801904:	83 c4 20             	add    $0x20,%esp
  801907:	85 c0                	test   %eax,%eax
  801909:	0f 88 38 03 00 00    	js     801c47 <spawn+0x540>
		goto error;
	if ((r = sys_page_unmap(0, UTEMP)) < 0)
  80190f:	83 ec 08             	sub    $0x8,%esp
  801912:	68 00 00 40 00       	push   $0x400000
  801917:	6a 00                	push   $0x0
  801919:	e8 1b f4 ff ff       	call   800d39 <sys_page_unmap>
  80191e:	89 c3                	mov    %eax,%ebx
  801920:	83 c4 10             	add    $0x10,%esp
  801923:	85 c0                	test   %eax,%eax
  801925:	0f 88 1c 03 00 00    	js     801c47 <spawn+0x540>
	ph = (struct Proghdr*) (elf_buf + elf->e_phoff);
  80192b:	8b 85 04 fe ff ff    	mov    -0x1fc(%ebp),%eax
  801931:	8d b4 05 e8 fd ff ff 	lea    -0x218(%ebp,%eax,1),%esi
	for (i = 0; i < elf->e_phnum; i++, ph++) {
  801938:	c7 85 84 fd ff ff 00 	movl   $0x0,-0x27c(%ebp)
  80193f:	00 00 00 
  801942:	e9 4f 01 00 00       	jmp    801a96 <spawn+0x38f>
	assert(string_store == (char*)UTEMP + PGSIZE);
  801947:	68 40 2b 80 00       	push   $0x802b40
  80194c:	68 9f 2a 80 00       	push   $0x802a9f
  801951:	68 f2 00 00 00       	push   $0xf2
  801956:	68 e5 2a 80 00       	push   $0x802ae5
  80195b:	e8 4a e8 ff ff       	call   8001aa <_panic>
			// allocate a blank page
			if ((r = sys_page_alloc(child, (void*) (va + i), perm)) < 0)
				return r;
		} else {
			// from file
			if ((r = sys_page_alloc(0, UTEMP, PTE_P|PTE_U|PTE_W)) < 0)
  801960:	83 ec 04             	sub    $0x4,%esp
  801963:	6a 07                	push   $0x7
  801965:	68 00 00 40 00       	push   $0x400000
  80196a:	6a 00                	push   $0x0
  80196c:	e8 3b f3 ff ff       	call   800cac <sys_page_alloc>
  801971:	83 c4 10             	add    $0x10,%esp
  801974:	85 c0                	test   %eax,%eax
  801976:	0f 88 a9 02 00 00    	js     801c25 <spawn+0x51e>
				return r;
			if ((r = seek(fd, fileoffset + i)) < 0)
  80197c:	83 ec 08             	sub    $0x8,%esp
  80197f:	8b 85 80 fd ff ff    	mov    -0x280(%ebp),%eax
  801985:	01 f0                	add    %esi,%eax
  801987:	50                   	push   %eax
  801988:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  80198e:	e8 8e f9 ff ff       	call   801321 <seek>
  801993:	83 c4 10             	add    $0x10,%esp
  801996:	85 c0                	test   %eax,%eax
  801998:	0f 88 8e 02 00 00    	js     801c2c <spawn+0x525>
				return r;
			if ((r = readn(fd, UTEMP, MIN(PGSIZE, filesz-i))) < 0)
  80199e:	83 ec 04             	sub    $0x4,%esp
  8019a1:	8b 85 90 fd ff ff    	mov    -0x270(%ebp),%eax
  8019a7:	29 f0                	sub    %esi,%eax
  8019a9:	3d 00 10 00 00       	cmp    $0x1000,%eax
  8019ae:	b9 00 10 00 00       	mov    $0x1000,%ecx
  8019b3:	0f 47 c1             	cmova  %ecx,%eax
  8019b6:	50                   	push   %eax
  8019b7:	68 00 00 40 00       	push   $0x400000
  8019bc:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  8019c2:	e8 89 f8 ff ff       	call   801250 <readn>
  8019c7:	83 c4 10             	add    $0x10,%esp
  8019ca:	85 c0                	test   %eax,%eax
  8019cc:	0f 88 61 02 00 00    	js     801c33 <spawn+0x52c>
				return r;
			if ((r = sys_page_map(0, UTEMP, child, (void*) (va + i), perm)) < 0)
  8019d2:	83 ec 0c             	sub    $0xc,%esp
  8019d5:	ff b5 8c fd ff ff    	pushl  -0x274(%ebp)
  8019db:	53                   	push   %ebx
  8019dc:	ff b5 88 fd ff ff    	pushl  -0x278(%ebp)
  8019e2:	68 00 00 40 00       	push   $0x400000
  8019e7:	6a 00                	push   $0x0
  8019e9:	e8 05 f3 ff ff       	call   800cf3 <sys_page_map>
  8019ee:	83 c4 20             	add    $0x20,%esp
  8019f1:	85 c0                	test   %eax,%eax
  8019f3:	78 7c                	js     801a71 <spawn+0x36a>
				panic("spawn: sys_page_map data: %e", r);
			sys_page_unmap(0, UTEMP);
  8019f5:	83 ec 08             	sub    $0x8,%esp
  8019f8:	68 00 00 40 00       	push   $0x400000
  8019fd:	6a 00                	push   $0x0
  8019ff:	e8 35 f3 ff ff       	call   800d39 <sys_page_unmap>
  801a04:	83 c4 10             	add    $0x10,%esp
	for (i = 0; i < memsz; i += PGSIZE) {
  801a07:	81 c7 00 10 00 00    	add    $0x1000,%edi
  801a0d:	81 c3 00 10 00 00    	add    $0x1000,%ebx
  801a13:	89 fe                	mov    %edi,%esi
  801a15:	39 bd 7c fd ff ff    	cmp    %edi,-0x284(%ebp)
  801a1b:	76 69                	jbe    801a86 <spawn+0x37f>
		if (i >= filesz) {
  801a1d:	39 bd 90 fd ff ff    	cmp    %edi,-0x270(%ebp)
  801a23:	0f 87 37 ff ff ff    	ja     801960 <spawn+0x259>
			if ((r = sys_page_alloc(child, (void*) (va + i), perm)) < 0)
  801a29:	83 ec 04             	sub    $0x4,%esp
  801a2c:	ff b5 8c fd ff ff    	pushl  -0x274(%ebp)
  801a32:	53                   	push   %ebx
  801a33:	ff b5 88 fd ff ff    	pushl  -0x278(%ebp)
  801a39:	e8 6e f2 ff ff       	call   800cac <sys_page_alloc>
  801a3e:	83 c4 10             	add    $0x10,%esp
  801a41:	85 c0                	test   %eax,%eax
  801a43:	79 c2                	jns    801a07 <spawn+0x300>
  801a45:	89 c7                	mov    %eax,%edi
	sys_env_destroy(child);
  801a47:	83 ec 0c             	sub    $0xc,%esp
  801a4a:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801a50:	e8 cc f1 ff ff       	call   800c21 <sys_env_destroy>
	close(fd);
  801a55:	83 c4 04             	add    $0x4,%esp
  801a58:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801a5e:	e8 18 f6 ff ff       	call   80107b <close>
	return r;
  801a63:	83 c4 10             	add    $0x10,%esp
  801a66:	89 bd 94 fd ff ff    	mov    %edi,-0x26c(%ebp)
  801a6c:	e9 a6 01 00 00       	jmp    801c17 <spawn+0x510>
				panic("spawn: sys_page_map data: %e", r);
  801a71:	50                   	push   %eax
  801a72:	68 f1 2a 80 00       	push   $0x802af1
  801a77:	68 25 01 00 00       	push   $0x125
  801a7c:	68 e5 2a 80 00       	push   $0x802ae5
  801a81:	e8 24 e7 ff ff       	call   8001aa <_panic>
  801a86:	8b b5 78 fd ff ff    	mov    -0x288(%ebp),%esi
	for (i = 0; i < elf->e_phnum; i++, ph++) {
  801a8c:	83 85 84 fd ff ff 01 	addl   $0x1,-0x27c(%ebp)
  801a93:	83 c6 20             	add    $0x20,%esi
  801a96:	0f b7 85 14 fe ff ff 	movzwl -0x1ec(%ebp),%eax
  801a9d:	3b 85 84 fd ff ff    	cmp    -0x27c(%ebp),%eax
  801aa3:	7e 6d                	jle    801b12 <spawn+0x40b>
		if (ph->p_type != ELF_PROG_LOAD)
  801aa5:	83 3e 01             	cmpl   $0x1,(%esi)
  801aa8:	75 e2                	jne    801a8c <spawn+0x385>
		if (ph->p_flags & ELF_PROG_FLAG_WRITE)
  801aaa:	8b 46 18             	mov    0x18(%esi),%eax
  801aad:	83 e0 02             	and    $0x2,%eax
			perm |= PTE_W;
  801ab0:	83 f8 01             	cmp    $0x1,%eax
  801ab3:	19 c0                	sbb    %eax,%eax
  801ab5:	83 e0 fe             	and    $0xfffffffe,%eax
  801ab8:	83 c0 07             	add    $0x7,%eax
  801abb:	89 85 8c fd ff ff    	mov    %eax,-0x274(%ebp)
		if ((r = map_segment(child, ph->p_va, ph->p_memsz,
  801ac1:	8b 4e 04             	mov    0x4(%esi),%ecx
  801ac4:	89 8d 80 fd ff ff    	mov    %ecx,-0x280(%ebp)
  801aca:	8b 56 10             	mov    0x10(%esi),%edx
  801acd:	89 95 90 fd ff ff    	mov    %edx,-0x270(%ebp)
  801ad3:	8b 7e 14             	mov    0x14(%esi),%edi
  801ad6:	89 bd 7c fd ff ff    	mov    %edi,-0x284(%ebp)
  801adc:	8b 5e 08             	mov    0x8(%esi),%ebx
	if ((i = PGOFF(va))) {
  801adf:	89 d8                	mov    %ebx,%eax
  801ae1:	25 ff 0f 00 00       	and    $0xfff,%eax
  801ae6:	74 1a                	je     801b02 <spawn+0x3fb>
		va -= i;
  801ae8:	29 c3                	sub    %eax,%ebx
		memsz += i;
  801aea:	01 c7                	add    %eax,%edi
  801aec:	89 bd 7c fd ff ff    	mov    %edi,-0x284(%ebp)
		filesz += i;
  801af2:	01 c2                	add    %eax,%edx
  801af4:	89 95 90 fd ff ff    	mov    %edx,-0x270(%ebp)
		fileoffset -= i;
  801afa:	29 c1                	sub    %eax,%ecx
  801afc:	89 8d 80 fd ff ff    	mov    %ecx,-0x280(%ebp)
	for (i = 0; i < memsz; i += PGSIZE) {
  801b02:	bf 00 00 00 00       	mov    $0x0,%edi
  801b07:	89 b5 78 fd ff ff    	mov    %esi,-0x288(%ebp)
  801b0d:	e9 01 ff ff ff       	jmp    801a13 <spawn+0x30c>
	close(fd);
  801b12:	83 ec 0c             	sub    $0xc,%esp
  801b15:	ff b5 94 fd ff ff    	pushl  -0x26c(%ebp)
  801b1b:	e8 5b f5 ff ff       	call   80107b <close>
  801b20:	83 c4 10             	add    $0x10,%esp
static int
copy_shared_pages(envid_t child)
{
	// LAB 5: Your code here.
	uintptr_t addr;
	for (addr = 0; addr < UTOP; addr += PGSIZE) {
  801b23:	bb 00 00 00 00       	mov    $0x0,%ebx
  801b28:	8b b5 88 fd ff ff    	mov    -0x278(%ebp),%esi
  801b2e:	eb 2b                	jmp    801b5b <spawn+0x454>
		if ((uvpd[PDX(addr)] & PTE_P) && (uvpt[PGNUM(addr)] & PTE_P) &&
				(uvpt[PGNUM(addr)] & PTE_U) && (uvpt[PGNUM(addr)] & PTE_SHARE)) {
            sys_page_map(0, (void*)addr, child, (void*)addr, (uvpt[PGNUM(addr)] & PTE_SYSCALL));
  801b30:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801b37:	83 ec 0c             	sub    $0xc,%esp
  801b3a:	25 07 0e 00 00       	and    $0xe07,%eax
  801b3f:	50                   	push   %eax
  801b40:	53                   	push   %ebx
  801b41:	56                   	push   %esi
  801b42:	53                   	push   %ebx
  801b43:	6a 00                	push   $0x0
  801b45:	e8 a9 f1 ff ff       	call   800cf3 <sys_page_map>
  801b4a:	83 c4 20             	add    $0x20,%esp
	for (addr = 0; addr < UTOP; addr += PGSIZE) {
  801b4d:	81 c3 00 10 00 00    	add    $0x1000,%ebx
  801b53:	81 fb 00 00 c0 ee    	cmp    $0xeec00000,%ebx
  801b59:	74 3b                	je     801b96 <spawn+0x48f>
		if ((uvpd[PDX(addr)] & PTE_P) && (uvpt[PGNUM(addr)] & PTE_P) &&
  801b5b:	89 d8                	mov    %ebx,%eax
  801b5d:	c1 e8 16             	shr    $0x16,%eax
  801b60:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801b67:	a8 01                	test   $0x1,%al
  801b69:	74 e2                	je     801b4d <spawn+0x446>
  801b6b:	89 d8                	mov    %ebx,%eax
  801b6d:	c1 e8 0c             	shr    $0xc,%eax
  801b70:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801b77:	f6 c2 01             	test   $0x1,%dl
  801b7a:	74 d1                	je     801b4d <spawn+0x446>
				(uvpt[PGNUM(addr)] & PTE_U) && (uvpt[PGNUM(addr)] & PTE_SHARE)) {
  801b7c:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
		if ((uvpd[PDX(addr)] & PTE_P) && (uvpt[PGNUM(addr)] & PTE_P) &&
  801b83:	f6 c2 04             	test   $0x4,%dl
  801b86:	74 c5                	je     801b4d <spawn+0x446>
				(uvpt[PGNUM(addr)] & PTE_U) && (uvpt[PGNUM(addr)] & PTE_SHARE)) {
  801b88:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801b8f:	f6 c6 04             	test   $0x4,%dh
  801b92:	74 b9                	je     801b4d <spawn+0x446>
  801b94:	eb 9a                	jmp    801b30 <spawn+0x429>
	child_tf.tf_eflags |= FL_IOPL_3;   // devious: see user/faultio.c
  801b96:	81 8d dc fd ff ff 00 	orl    $0x3000,-0x224(%ebp)
  801b9d:	30 00 00 
	if ((r = sys_env_set_trapframe(child, &child_tf)) < 0)
  801ba0:	83 ec 08             	sub    $0x8,%esp
  801ba3:	8d 85 a4 fd ff ff    	lea    -0x25c(%ebp),%eax
  801ba9:	50                   	push   %eax
  801baa:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801bb0:	e8 10 f2 ff ff       	call   800dc5 <sys_env_set_trapframe>
  801bb5:	83 c4 10             	add    $0x10,%esp
  801bb8:	85 c0                	test   %eax,%eax
  801bba:	78 25                	js     801be1 <spawn+0x4da>
	if ((r = sys_env_set_status(child, ENV_RUNNABLE)) < 0)
  801bbc:	83 ec 08             	sub    $0x8,%esp
  801bbf:	6a 02                	push   $0x2
  801bc1:	ff b5 74 fd ff ff    	pushl  -0x28c(%ebp)
  801bc7:	e8 b3 f1 ff ff       	call   800d7f <sys_env_set_status>
  801bcc:	83 c4 10             	add    $0x10,%esp
  801bcf:	85 c0                	test   %eax,%eax
  801bd1:	78 23                	js     801bf6 <spawn+0x4ef>
	return child;
  801bd3:	8b 85 74 fd ff ff    	mov    -0x28c(%ebp),%eax
  801bd9:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
  801bdf:	eb 36                	jmp    801c17 <spawn+0x510>
		panic("sys_env_set_trapframe: %e", r);
  801be1:	50                   	push   %eax
  801be2:	68 0e 2b 80 00       	push   $0x802b0e
  801be7:	68 86 00 00 00       	push   $0x86
  801bec:	68 e5 2a 80 00       	push   $0x802ae5
  801bf1:	e8 b4 e5 ff ff       	call   8001aa <_panic>
		panic("sys_env_set_status: %e", r);
  801bf6:	50                   	push   %eax
  801bf7:	68 28 2b 80 00       	push   $0x802b28
  801bfc:	68 89 00 00 00       	push   $0x89
  801c01:	68 e5 2a 80 00       	push   $0x802ae5
  801c06:	e8 9f e5 ff ff       	call   8001aa <_panic>
		return r;
  801c0b:	8b 85 74 fd ff ff    	mov    -0x28c(%ebp),%eax
  801c11:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
}
  801c17:	8b 85 94 fd ff ff    	mov    -0x26c(%ebp),%eax
  801c1d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c20:	5b                   	pop    %ebx
  801c21:	5e                   	pop    %esi
  801c22:	5f                   	pop    %edi
  801c23:	5d                   	pop    %ebp
  801c24:	c3                   	ret    
  801c25:	89 c7                	mov    %eax,%edi
  801c27:	e9 1b fe ff ff       	jmp    801a47 <spawn+0x340>
  801c2c:	89 c7                	mov    %eax,%edi
  801c2e:	e9 14 fe ff ff       	jmp    801a47 <spawn+0x340>
  801c33:	89 c7                	mov    %eax,%edi
  801c35:	e9 0d fe ff ff       	jmp    801a47 <spawn+0x340>
		return -E_NO_MEM;
  801c3a:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
	for (addr = 0; addr < UTOP; addr += PGSIZE) {
  801c3f:	89 85 94 fd ff ff    	mov    %eax,-0x26c(%ebp)
  801c45:	eb d0                	jmp    801c17 <spawn+0x510>
	sys_page_unmap(0, UTEMP);
  801c47:	83 ec 08             	sub    $0x8,%esp
  801c4a:	68 00 00 40 00       	push   $0x400000
  801c4f:	6a 00                	push   $0x0
  801c51:	e8 e3 f0 ff ff       	call   800d39 <sys_page_unmap>
  801c56:	83 c4 10             	add    $0x10,%esp
  801c59:	89 9d 94 fd ff ff    	mov    %ebx,-0x26c(%ebp)
  801c5f:	eb b6                	jmp    801c17 <spawn+0x510>

00801c61 <spawnl>:
{
  801c61:	f3 0f 1e fb          	endbr32 
  801c65:	55                   	push   %ebp
  801c66:	89 e5                	mov    %esp,%ebp
  801c68:	57                   	push   %edi
  801c69:	56                   	push   %esi
  801c6a:	53                   	push   %ebx
  801c6b:	83 ec 0c             	sub    $0xc,%esp
	va_start(vl, arg0);
  801c6e:	8d 55 10             	lea    0x10(%ebp),%edx
	int argc=0;
  801c71:	b8 00 00 00 00       	mov    $0x0,%eax
	while(va_arg(vl, void *) != NULL)
  801c76:	8d 4a 04             	lea    0x4(%edx),%ecx
  801c79:	83 3a 00             	cmpl   $0x0,(%edx)
  801c7c:	74 07                	je     801c85 <spawnl+0x24>
		argc++;
  801c7e:	83 c0 01             	add    $0x1,%eax
	while(va_arg(vl, void *) != NULL)
  801c81:	89 ca                	mov    %ecx,%edx
  801c83:	eb f1                	jmp    801c76 <spawnl+0x15>
	const char *argv[argc+2];
  801c85:	8d 14 85 17 00 00 00 	lea    0x17(,%eax,4),%edx
  801c8c:	89 d1                	mov    %edx,%ecx
  801c8e:	83 e1 f0             	and    $0xfffffff0,%ecx
  801c91:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
  801c97:	89 e6                	mov    %esp,%esi
  801c99:	29 d6                	sub    %edx,%esi
  801c9b:	89 f2                	mov    %esi,%edx
  801c9d:	39 d4                	cmp    %edx,%esp
  801c9f:	74 10                	je     801cb1 <spawnl+0x50>
  801ca1:	81 ec 00 10 00 00    	sub    $0x1000,%esp
  801ca7:	83 8c 24 fc 0f 00 00 	orl    $0x0,0xffc(%esp)
  801cae:	00 
  801caf:	eb ec                	jmp    801c9d <spawnl+0x3c>
  801cb1:	89 ca                	mov    %ecx,%edx
  801cb3:	81 e2 ff 0f 00 00    	and    $0xfff,%edx
  801cb9:	29 d4                	sub    %edx,%esp
  801cbb:	85 d2                	test   %edx,%edx
  801cbd:	74 05                	je     801cc4 <spawnl+0x63>
  801cbf:	83 4c 14 fc 00       	orl    $0x0,-0x4(%esp,%edx,1)
  801cc4:	8d 74 24 03          	lea    0x3(%esp),%esi
  801cc8:	89 f2                	mov    %esi,%edx
  801cca:	c1 ea 02             	shr    $0x2,%edx
  801ccd:	83 e6 fc             	and    $0xfffffffc,%esi
  801cd0:	89 f3                	mov    %esi,%ebx
	argv[0] = arg0;
  801cd2:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801cd5:	89 0c 95 00 00 00 00 	mov    %ecx,0x0(,%edx,4)
	argv[argc+1] = NULL;
  801cdc:	c7 44 86 04 00 00 00 	movl   $0x0,0x4(%esi,%eax,4)
  801ce3:	00 
	va_start(vl, arg0);
  801ce4:	8d 4d 10             	lea    0x10(%ebp),%ecx
  801ce7:	89 c2                	mov    %eax,%edx
	for(i=0;i<argc;i++)
  801ce9:	b8 00 00 00 00       	mov    $0x0,%eax
  801cee:	eb 0b                	jmp    801cfb <spawnl+0x9a>
		argv[i+1] = va_arg(vl, const char *);
  801cf0:	83 c0 01             	add    $0x1,%eax
  801cf3:	8b 39                	mov    (%ecx),%edi
  801cf5:	89 3c 83             	mov    %edi,(%ebx,%eax,4)
  801cf8:	8d 49 04             	lea    0x4(%ecx),%ecx
	for(i=0;i<argc;i++)
  801cfb:	39 d0                	cmp    %edx,%eax
  801cfd:	75 f1                	jne    801cf0 <spawnl+0x8f>
	return spawn(prog, argv);
  801cff:	83 ec 08             	sub    $0x8,%esp
  801d02:	56                   	push   %esi
  801d03:	ff 75 08             	pushl  0x8(%ebp)
  801d06:	e8 fc f9 ff ff       	call   801707 <spawn>
}
  801d0b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801d0e:	5b                   	pop    %ebx
  801d0f:	5e                   	pop    %esi
  801d10:	5f                   	pop    %edi
  801d11:	5d                   	pop    %ebp
  801d12:	c3                   	ret    

00801d13 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801d13:	f3 0f 1e fb          	endbr32 
  801d17:	55                   	push   %ebp
  801d18:	89 e5                	mov    %esp,%ebp
  801d1a:	56                   	push   %esi
  801d1b:	53                   	push   %ebx
  801d1c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  801d1f:	83 ec 0c             	sub    $0xc,%esp
  801d22:	ff 75 08             	pushl  0x8(%ebp)
  801d25:	e8 a7 f1 ff ff       	call   800ed1 <fd2data>
  801d2a:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801d2c:	83 c4 08             	add    $0x8,%esp
  801d2f:	68 66 2b 80 00       	push   $0x802b66
  801d34:	53                   	push   %ebx
  801d35:	e8 30 eb ff ff       	call   80086a <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801d3a:	8b 46 04             	mov    0x4(%esi),%eax
  801d3d:	2b 06                	sub    (%esi),%eax
  801d3f:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801d45:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801d4c:	00 00 00 
	stat->st_dev = &devpipe;
  801d4f:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  801d56:	30 80 00 
	return 0;
}
  801d59:	b8 00 00 00 00       	mov    $0x0,%eax
  801d5e:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801d61:	5b                   	pop    %ebx
  801d62:	5e                   	pop    %esi
  801d63:	5d                   	pop    %ebp
  801d64:	c3                   	ret    

00801d65 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801d65:	f3 0f 1e fb          	endbr32 
  801d69:	55                   	push   %ebp
  801d6a:	89 e5                	mov    %esp,%ebp
  801d6c:	53                   	push   %ebx
  801d6d:	83 ec 0c             	sub    $0xc,%esp
  801d70:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801d73:	53                   	push   %ebx
  801d74:	6a 00                	push   $0x0
  801d76:	e8 be ef ff ff       	call   800d39 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  801d7b:	89 1c 24             	mov    %ebx,(%esp)
  801d7e:	e8 4e f1 ff ff       	call   800ed1 <fd2data>
  801d83:	83 c4 08             	add    $0x8,%esp
  801d86:	50                   	push   %eax
  801d87:	6a 00                	push   $0x0
  801d89:	e8 ab ef ff ff       	call   800d39 <sys_page_unmap>
}
  801d8e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801d91:	c9                   	leave  
  801d92:	c3                   	ret    

00801d93 <_pipeisclosed>:
{
  801d93:	55                   	push   %ebp
  801d94:	89 e5                	mov    %esp,%ebp
  801d96:	57                   	push   %edi
  801d97:	56                   	push   %esi
  801d98:	53                   	push   %ebx
  801d99:	83 ec 1c             	sub    $0x1c,%esp
  801d9c:	89 c7                	mov    %eax,%edi
  801d9e:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  801da0:	a1 04 40 80 00       	mov    0x804004,%eax
  801da5:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  801da8:	83 ec 0c             	sub    $0xc,%esp
  801dab:	57                   	push   %edi
  801dac:	e8 73 05 00 00       	call   802324 <pageref>
  801db1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801db4:	89 34 24             	mov    %esi,(%esp)
  801db7:	e8 68 05 00 00       	call   802324 <pageref>
		nn = thisenv->env_runs;
  801dbc:	8b 15 04 40 80 00    	mov    0x804004,%edx
  801dc2:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  801dc5:	83 c4 10             	add    $0x10,%esp
  801dc8:	39 cb                	cmp    %ecx,%ebx
  801dca:	74 1b                	je     801de7 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  801dcc:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801dcf:	75 cf                	jne    801da0 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  801dd1:	8b 42 58             	mov    0x58(%edx),%eax
  801dd4:	6a 01                	push   $0x1
  801dd6:	50                   	push   %eax
  801dd7:	53                   	push   %ebx
  801dd8:	68 6d 2b 80 00       	push   $0x802b6d
  801ddd:	e8 af e4 ff ff       	call   800291 <cprintf>
  801de2:	83 c4 10             	add    $0x10,%esp
  801de5:	eb b9                	jmp    801da0 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  801de7:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801dea:	0f 94 c0             	sete   %al
  801ded:	0f b6 c0             	movzbl %al,%eax
}
  801df0:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801df3:	5b                   	pop    %ebx
  801df4:	5e                   	pop    %esi
  801df5:	5f                   	pop    %edi
  801df6:	5d                   	pop    %ebp
  801df7:	c3                   	ret    

00801df8 <devpipe_write>:
{
  801df8:	f3 0f 1e fb          	endbr32 
  801dfc:	55                   	push   %ebp
  801dfd:	89 e5                	mov    %esp,%ebp
  801dff:	57                   	push   %edi
  801e00:	56                   	push   %esi
  801e01:	53                   	push   %ebx
  801e02:	83 ec 28             	sub    $0x28,%esp
  801e05:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  801e08:	56                   	push   %esi
  801e09:	e8 c3 f0 ff ff       	call   800ed1 <fd2data>
  801e0e:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801e10:	83 c4 10             	add    $0x10,%esp
  801e13:	bf 00 00 00 00       	mov    $0x0,%edi
  801e18:	3b 7d 10             	cmp    0x10(%ebp),%edi
  801e1b:	74 4f                	je     801e6c <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  801e1d:	8b 43 04             	mov    0x4(%ebx),%eax
  801e20:	8b 0b                	mov    (%ebx),%ecx
  801e22:	8d 51 20             	lea    0x20(%ecx),%edx
  801e25:	39 d0                	cmp    %edx,%eax
  801e27:	72 14                	jb     801e3d <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  801e29:	89 da                	mov    %ebx,%edx
  801e2b:	89 f0                	mov    %esi,%eax
  801e2d:	e8 61 ff ff ff       	call   801d93 <_pipeisclosed>
  801e32:	85 c0                	test   %eax,%eax
  801e34:	75 3b                	jne    801e71 <devpipe_write+0x79>
			sys_yield();
  801e36:	e8 4e ee ff ff       	call   800c89 <sys_yield>
  801e3b:	eb e0                	jmp    801e1d <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801e3d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801e40:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801e44:	88 4d e7             	mov    %cl,-0x19(%ebp)
  801e47:	89 c2                	mov    %eax,%edx
  801e49:	c1 fa 1f             	sar    $0x1f,%edx
  801e4c:	89 d1                	mov    %edx,%ecx
  801e4e:	c1 e9 1b             	shr    $0x1b,%ecx
  801e51:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801e54:	83 e2 1f             	and    $0x1f,%edx
  801e57:	29 ca                	sub    %ecx,%edx
  801e59:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801e5d:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801e61:	83 c0 01             	add    $0x1,%eax
  801e64:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  801e67:	83 c7 01             	add    $0x1,%edi
  801e6a:	eb ac                	jmp    801e18 <devpipe_write+0x20>
	return i;
  801e6c:	8b 45 10             	mov    0x10(%ebp),%eax
  801e6f:	eb 05                	jmp    801e76 <devpipe_write+0x7e>
				return 0;
  801e71:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801e76:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801e79:	5b                   	pop    %ebx
  801e7a:	5e                   	pop    %esi
  801e7b:	5f                   	pop    %edi
  801e7c:	5d                   	pop    %ebp
  801e7d:	c3                   	ret    

00801e7e <devpipe_read>:
{
  801e7e:	f3 0f 1e fb          	endbr32 
  801e82:	55                   	push   %ebp
  801e83:	89 e5                	mov    %esp,%ebp
  801e85:	57                   	push   %edi
  801e86:	56                   	push   %esi
  801e87:	53                   	push   %ebx
  801e88:	83 ec 18             	sub    $0x18,%esp
  801e8b:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  801e8e:	57                   	push   %edi
  801e8f:	e8 3d f0 ff ff       	call   800ed1 <fd2data>
  801e94:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801e96:	83 c4 10             	add    $0x10,%esp
  801e99:	be 00 00 00 00       	mov    $0x0,%esi
  801e9e:	3b 75 10             	cmp    0x10(%ebp),%esi
  801ea1:	75 14                	jne    801eb7 <devpipe_read+0x39>
	return i;
  801ea3:	8b 45 10             	mov    0x10(%ebp),%eax
  801ea6:	eb 02                	jmp    801eaa <devpipe_read+0x2c>
				return i;
  801ea8:	89 f0                	mov    %esi,%eax
}
  801eaa:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801ead:	5b                   	pop    %ebx
  801eae:	5e                   	pop    %esi
  801eaf:	5f                   	pop    %edi
  801eb0:	5d                   	pop    %ebp
  801eb1:	c3                   	ret    
			sys_yield();
  801eb2:	e8 d2 ed ff ff       	call   800c89 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  801eb7:	8b 03                	mov    (%ebx),%eax
  801eb9:	3b 43 04             	cmp    0x4(%ebx),%eax
  801ebc:	75 18                	jne    801ed6 <devpipe_read+0x58>
			if (i > 0)
  801ebe:	85 f6                	test   %esi,%esi
  801ec0:	75 e6                	jne    801ea8 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  801ec2:	89 da                	mov    %ebx,%edx
  801ec4:	89 f8                	mov    %edi,%eax
  801ec6:	e8 c8 fe ff ff       	call   801d93 <_pipeisclosed>
  801ecb:	85 c0                	test   %eax,%eax
  801ecd:	74 e3                	je     801eb2 <devpipe_read+0x34>
				return 0;
  801ecf:	b8 00 00 00 00       	mov    $0x0,%eax
  801ed4:	eb d4                	jmp    801eaa <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  801ed6:	99                   	cltd   
  801ed7:	c1 ea 1b             	shr    $0x1b,%edx
  801eda:	01 d0                	add    %edx,%eax
  801edc:	83 e0 1f             	and    $0x1f,%eax
  801edf:	29 d0                	sub    %edx,%eax
  801ee1:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  801ee6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801ee9:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  801eec:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  801eef:	83 c6 01             	add    $0x1,%esi
  801ef2:	eb aa                	jmp    801e9e <devpipe_read+0x20>

00801ef4 <pipe>:
{
  801ef4:	f3 0f 1e fb          	endbr32 
  801ef8:	55                   	push   %ebp
  801ef9:	89 e5                	mov    %esp,%ebp
  801efb:	56                   	push   %esi
  801efc:	53                   	push   %ebx
  801efd:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  801f00:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801f03:	50                   	push   %eax
  801f04:	e8 e3 ef ff ff       	call   800eec <fd_alloc>
  801f09:	89 c3                	mov    %eax,%ebx
  801f0b:	83 c4 10             	add    $0x10,%esp
  801f0e:	85 c0                	test   %eax,%eax
  801f10:	0f 88 23 01 00 00    	js     802039 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801f16:	83 ec 04             	sub    $0x4,%esp
  801f19:	68 07 04 00 00       	push   $0x407
  801f1e:	ff 75 f4             	pushl  -0xc(%ebp)
  801f21:	6a 00                	push   $0x0
  801f23:	e8 84 ed ff ff       	call   800cac <sys_page_alloc>
  801f28:	89 c3                	mov    %eax,%ebx
  801f2a:	83 c4 10             	add    $0x10,%esp
  801f2d:	85 c0                	test   %eax,%eax
  801f2f:	0f 88 04 01 00 00    	js     802039 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801f35:	83 ec 0c             	sub    $0xc,%esp
  801f38:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801f3b:	50                   	push   %eax
  801f3c:	e8 ab ef ff ff       	call   800eec <fd_alloc>
  801f41:	89 c3                	mov    %eax,%ebx
  801f43:	83 c4 10             	add    $0x10,%esp
  801f46:	85 c0                	test   %eax,%eax
  801f48:	0f 88 db 00 00 00    	js     802029 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801f4e:	83 ec 04             	sub    $0x4,%esp
  801f51:	68 07 04 00 00       	push   $0x407
  801f56:	ff 75 f0             	pushl  -0x10(%ebp)
  801f59:	6a 00                	push   $0x0
  801f5b:	e8 4c ed ff ff       	call   800cac <sys_page_alloc>
  801f60:	89 c3                	mov    %eax,%ebx
  801f62:	83 c4 10             	add    $0x10,%esp
  801f65:	85 c0                	test   %eax,%eax
  801f67:	0f 88 bc 00 00 00    	js     802029 <pipe+0x135>
	va = fd2data(fd0);
  801f6d:	83 ec 0c             	sub    $0xc,%esp
  801f70:	ff 75 f4             	pushl  -0xc(%ebp)
  801f73:	e8 59 ef ff ff       	call   800ed1 <fd2data>
  801f78:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801f7a:	83 c4 0c             	add    $0xc,%esp
  801f7d:	68 07 04 00 00       	push   $0x407
  801f82:	50                   	push   %eax
  801f83:	6a 00                	push   $0x0
  801f85:	e8 22 ed ff ff       	call   800cac <sys_page_alloc>
  801f8a:	89 c3                	mov    %eax,%ebx
  801f8c:	83 c4 10             	add    $0x10,%esp
  801f8f:	85 c0                	test   %eax,%eax
  801f91:	0f 88 82 00 00 00    	js     802019 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801f97:	83 ec 0c             	sub    $0xc,%esp
  801f9a:	ff 75 f0             	pushl  -0x10(%ebp)
  801f9d:	e8 2f ef ff ff       	call   800ed1 <fd2data>
  801fa2:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  801fa9:	50                   	push   %eax
  801faa:	6a 00                	push   $0x0
  801fac:	56                   	push   %esi
  801fad:	6a 00                	push   $0x0
  801faf:	e8 3f ed ff ff       	call   800cf3 <sys_page_map>
  801fb4:	89 c3                	mov    %eax,%ebx
  801fb6:	83 c4 20             	add    $0x20,%esp
  801fb9:	85 c0                	test   %eax,%eax
  801fbb:	78 4e                	js     80200b <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801fbd:	a1 20 30 80 00       	mov    0x803020,%eax
  801fc2:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801fc5:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  801fc7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801fca:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  801fd1:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801fd4:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  801fd6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801fd9:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  801fe0:	83 ec 0c             	sub    $0xc,%esp
  801fe3:	ff 75 f4             	pushl  -0xc(%ebp)
  801fe6:	e8 d2 ee ff ff       	call   800ebd <fd2num>
  801feb:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801fee:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801ff0:	83 c4 04             	add    $0x4,%esp
  801ff3:	ff 75 f0             	pushl  -0x10(%ebp)
  801ff6:	e8 c2 ee ff ff       	call   800ebd <fd2num>
  801ffb:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801ffe:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  802001:	83 c4 10             	add    $0x10,%esp
  802004:	bb 00 00 00 00       	mov    $0x0,%ebx
  802009:	eb 2e                	jmp    802039 <pipe+0x145>
	sys_page_unmap(0, va);
  80200b:	83 ec 08             	sub    $0x8,%esp
  80200e:	56                   	push   %esi
  80200f:	6a 00                	push   $0x0
  802011:	e8 23 ed ff ff       	call   800d39 <sys_page_unmap>
  802016:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  802019:	83 ec 08             	sub    $0x8,%esp
  80201c:	ff 75 f0             	pushl  -0x10(%ebp)
  80201f:	6a 00                	push   $0x0
  802021:	e8 13 ed ff ff       	call   800d39 <sys_page_unmap>
  802026:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  802029:	83 ec 08             	sub    $0x8,%esp
  80202c:	ff 75 f4             	pushl  -0xc(%ebp)
  80202f:	6a 00                	push   $0x0
  802031:	e8 03 ed ff ff       	call   800d39 <sys_page_unmap>
  802036:	83 c4 10             	add    $0x10,%esp
}
  802039:	89 d8                	mov    %ebx,%eax
  80203b:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80203e:	5b                   	pop    %ebx
  80203f:	5e                   	pop    %esi
  802040:	5d                   	pop    %ebp
  802041:	c3                   	ret    

00802042 <pipeisclosed>:
{
  802042:	f3 0f 1e fb          	endbr32 
  802046:	55                   	push   %ebp
  802047:	89 e5                	mov    %esp,%ebp
  802049:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80204c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80204f:	50                   	push   %eax
  802050:	ff 75 08             	pushl  0x8(%ebp)
  802053:	e8 ea ee ff ff       	call   800f42 <fd_lookup>
  802058:	83 c4 10             	add    $0x10,%esp
  80205b:	85 c0                	test   %eax,%eax
  80205d:	78 18                	js     802077 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  80205f:	83 ec 0c             	sub    $0xc,%esp
  802062:	ff 75 f4             	pushl  -0xc(%ebp)
  802065:	e8 67 ee ff ff       	call   800ed1 <fd2data>
  80206a:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  80206c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80206f:	e8 1f fd ff ff       	call   801d93 <_pipeisclosed>
  802074:	83 c4 10             	add    $0x10,%esp
}
  802077:	c9                   	leave  
  802078:	c3                   	ret    

00802079 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  802079:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  80207d:	b8 00 00 00 00       	mov    $0x0,%eax
  802082:	c3                   	ret    

00802083 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  802083:	f3 0f 1e fb          	endbr32 
  802087:	55                   	push   %ebp
  802088:	89 e5                	mov    %esp,%ebp
  80208a:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  80208d:	68 85 2b 80 00       	push   $0x802b85
  802092:	ff 75 0c             	pushl  0xc(%ebp)
  802095:	e8 d0 e7 ff ff       	call   80086a <strcpy>
	return 0;
}
  80209a:	b8 00 00 00 00       	mov    $0x0,%eax
  80209f:	c9                   	leave  
  8020a0:	c3                   	ret    

008020a1 <devcons_write>:
{
  8020a1:	f3 0f 1e fb          	endbr32 
  8020a5:	55                   	push   %ebp
  8020a6:	89 e5                	mov    %esp,%ebp
  8020a8:	57                   	push   %edi
  8020a9:	56                   	push   %esi
  8020aa:	53                   	push   %ebx
  8020ab:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  8020b1:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  8020b6:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  8020bc:	3b 75 10             	cmp    0x10(%ebp),%esi
  8020bf:	73 31                	jae    8020f2 <devcons_write+0x51>
		m = n - tot;
  8020c1:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8020c4:	29 f3                	sub    %esi,%ebx
  8020c6:	83 fb 7f             	cmp    $0x7f,%ebx
  8020c9:	b8 7f 00 00 00       	mov    $0x7f,%eax
  8020ce:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  8020d1:	83 ec 04             	sub    $0x4,%esp
  8020d4:	53                   	push   %ebx
  8020d5:	89 f0                	mov    %esi,%eax
  8020d7:	03 45 0c             	add    0xc(%ebp),%eax
  8020da:	50                   	push   %eax
  8020db:	57                   	push   %edi
  8020dc:	e8 3f e9 ff ff       	call   800a20 <memmove>
		sys_cputs(buf, m);
  8020e1:	83 c4 08             	add    $0x8,%esp
  8020e4:	53                   	push   %ebx
  8020e5:	57                   	push   %edi
  8020e6:	e8 f1 ea ff ff       	call   800bdc <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  8020eb:	01 de                	add    %ebx,%esi
  8020ed:	83 c4 10             	add    $0x10,%esp
  8020f0:	eb ca                	jmp    8020bc <devcons_write+0x1b>
}
  8020f2:	89 f0                	mov    %esi,%eax
  8020f4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8020f7:	5b                   	pop    %ebx
  8020f8:	5e                   	pop    %esi
  8020f9:	5f                   	pop    %edi
  8020fa:	5d                   	pop    %ebp
  8020fb:	c3                   	ret    

008020fc <devcons_read>:
{
  8020fc:	f3 0f 1e fb          	endbr32 
  802100:	55                   	push   %ebp
  802101:	89 e5                	mov    %esp,%ebp
  802103:	83 ec 08             	sub    $0x8,%esp
  802106:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  80210b:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  80210f:	74 21                	je     802132 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  802111:	e8 e8 ea ff ff       	call   800bfe <sys_cgetc>
  802116:	85 c0                	test   %eax,%eax
  802118:	75 07                	jne    802121 <devcons_read+0x25>
		sys_yield();
  80211a:	e8 6a eb ff ff       	call   800c89 <sys_yield>
  80211f:	eb f0                	jmp    802111 <devcons_read+0x15>
	if (c < 0)
  802121:	78 0f                	js     802132 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  802123:	83 f8 04             	cmp    $0x4,%eax
  802126:	74 0c                	je     802134 <devcons_read+0x38>
	*(char*)vbuf = c;
  802128:	8b 55 0c             	mov    0xc(%ebp),%edx
  80212b:	88 02                	mov    %al,(%edx)
	return 1;
  80212d:	b8 01 00 00 00       	mov    $0x1,%eax
}
  802132:	c9                   	leave  
  802133:	c3                   	ret    
		return 0;
  802134:	b8 00 00 00 00       	mov    $0x0,%eax
  802139:	eb f7                	jmp    802132 <devcons_read+0x36>

0080213b <cputchar>:
{
  80213b:	f3 0f 1e fb          	endbr32 
  80213f:	55                   	push   %ebp
  802140:	89 e5                	mov    %esp,%ebp
  802142:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  802145:	8b 45 08             	mov    0x8(%ebp),%eax
  802148:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  80214b:	6a 01                	push   $0x1
  80214d:	8d 45 f7             	lea    -0x9(%ebp),%eax
  802150:	50                   	push   %eax
  802151:	e8 86 ea ff ff       	call   800bdc <sys_cputs>
}
  802156:	83 c4 10             	add    $0x10,%esp
  802159:	c9                   	leave  
  80215a:	c3                   	ret    

0080215b <getchar>:
{
  80215b:	f3 0f 1e fb          	endbr32 
  80215f:	55                   	push   %ebp
  802160:	89 e5                	mov    %esp,%ebp
  802162:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  802165:	6a 01                	push   $0x1
  802167:	8d 45 f7             	lea    -0x9(%ebp),%eax
  80216a:	50                   	push   %eax
  80216b:	6a 00                	push   $0x0
  80216d:	e8 53 f0 ff ff       	call   8011c5 <read>
	if (r < 0)
  802172:	83 c4 10             	add    $0x10,%esp
  802175:	85 c0                	test   %eax,%eax
  802177:	78 06                	js     80217f <getchar+0x24>
	if (r < 1)
  802179:	74 06                	je     802181 <getchar+0x26>
	return c;
  80217b:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  80217f:	c9                   	leave  
  802180:	c3                   	ret    
		return -E_EOF;
  802181:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  802186:	eb f7                	jmp    80217f <getchar+0x24>

00802188 <iscons>:
{
  802188:	f3 0f 1e fb          	endbr32 
  80218c:	55                   	push   %ebp
  80218d:	89 e5                	mov    %esp,%ebp
  80218f:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  802192:	8d 45 f4             	lea    -0xc(%ebp),%eax
  802195:	50                   	push   %eax
  802196:	ff 75 08             	pushl  0x8(%ebp)
  802199:	e8 a4 ed ff ff       	call   800f42 <fd_lookup>
  80219e:	83 c4 10             	add    $0x10,%esp
  8021a1:	85 c0                	test   %eax,%eax
  8021a3:	78 11                	js     8021b6 <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  8021a5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8021a8:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  8021ae:	39 10                	cmp    %edx,(%eax)
  8021b0:	0f 94 c0             	sete   %al
  8021b3:	0f b6 c0             	movzbl %al,%eax
}
  8021b6:	c9                   	leave  
  8021b7:	c3                   	ret    

008021b8 <opencons>:
{
  8021b8:	f3 0f 1e fb          	endbr32 
  8021bc:	55                   	push   %ebp
  8021bd:	89 e5                	mov    %esp,%ebp
  8021bf:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  8021c2:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8021c5:	50                   	push   %eax
  8021c6:	e8 21 ed ff ff       	call   800eec <fd_alloc>
  8021cb:	83 c4 10             	add    $0x10,%esp
  8021ce:	85 c0                	test   %eax,%eax
  8021d0:	78 3a                	js     80220c <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  8021d2:	83 ec 04             	sub    $0x4,%esp
  8021d5:	68 07 04 00 00       	push   $0x407
  8021da:	ff 75 f4             	pushl  -0xc(%ebp)
  8021dd:	6a 00                	push   $0x0
  8021df:	e8 c8 ea ff ff       	call   800cac <sys_page_alloc>
  8021e4:	83 c4 10             	add    $0x10,%esp
  8021e7:	85 c0                	test   %eax,%eax
  8021e9:	78 21                	js     80220c <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  8021eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8021ee:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  8021f4:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  8021f6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8021f9:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  802200:	83 ec 0c             	sub    $0xc,%esp
  802203:	50                   	push   %eax
  802204:	e8 b4 ec ff ff       	call   800ebd <fd2num>
  802209:	83 c4 10             	add    $0x10,%esp
}
  80220c:	c9                   	leave  
  80220d:	c3                   	ret    

0080220e <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  80220e:	f3 0f 1e fb          	endbr32 
  802212:	55                   	push   %ebp
  802213:	89 e5                	mov    %esp,%ebp
  802215:	56                   	push   %esi
  802216:	53                   	push   %ebx
  802217:	8b 75 08             	mov    0x8(%ebp),%esi
  80221a:	8b 45 0c             	mov    0xc(%ebp),%eax
  80221d:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  802220:	85 c0                	test   %eax,%eax
  802222:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  802227:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  80222a:	83 ec 0c             	sub    $0xc,%esp
  80222d:	50                   	push   %eax
  80222e:	e8 45 ec ff ff       	call   800e78 <sys_ipc_recv>
  802233:	83 c4 10             	add    $0x10,%esp
  802236:	85 c0                	test   %eax,%eax
  802238:	78 3f                	js     802279 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  80223a:	e8 27 ea ff ff       	call   800c66 <sys_getenvid>
  80223f:	25 ff 03 00 00       	and    $0x3ff,%eax
  802244:	6b d0 7c             	imul   $0x7c,%eax,%edx
  802247:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  80224d:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  802253:	85 f6                	test   %esi,%esi
  802255:	74 05                	je     80225c <ipc_recv+0x4e>
  802257:	8b 42 74             	mov    0x74(%edx),%eax
  80225a:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  80225c:	85 db                	test   %ebx,%ebx
  80225e:	74 0a                	je     80226a <ipc_recv+0x5c>
  802260:	a1 04 40 80 00       	mov    0x804004,%eax
  802265:	8b 40 78             	mov    0x78(%eax),%eax
  802268:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  80226a:	a1 04 40 80 00       	mov    0x804004,%eax
  80226f:	8b 40 70             	mov    0x70(%eax),%eax
}
  802272:	8d 65 f8             	lea    -0x8(%ebp),%esp
  802275:	5b                   	pop    %ebx
  802276:	5e                   	pop    %esi
  802277:	5d                   	pop    %ebp
  802278:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  802279:	85 f6                	test   %esi,%esi
  80227b:	74 06                	je     802283 <ipc_recv+0x75>
  80227d:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  802283:	85 db                	test   %ebx,%ebx
  802285:	74 eb                	je     802272 <ipc_recv+0x64>
  802287:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  80228d:	eb e3                	jmp    802272 <ipc_recv+0x64>

0080228f <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  80228f:	f3 0f 1e fb          	endbr32 
  802293:	55                   	push   %ebp
  802294:	89 e5                	mov    %esp,%ebp
  802296:	57                   	push   %edi
  802297:	56                   	push   %esi
  802298:	53                   	push   %ebx
  802299:	83 ec 0c             	sub    $0xc,%esp
  80229c:	8b 7d 08             	mov    0x8(%ebp),%edi
  80229f:	8b 75 0c             	mov    0xc(%ebp),%esi
  8022a2:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  8022a5:	85 db                	test   %ebx,%ebx
  8022a7:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  8022ac:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  8022af:	ff 75 14             	pushl  0x14(%ebp)
  8022b2:	53                   	push   %ebx
  8022b3:	56                   	push   %esi
  8022b4:	57                   	push   %edi
  8022b5:	e8 97 eb ff ff       	call   800e51 <sys_ipc_try_send>
  8022ba:	83 c4 10             	add    $0x10,%esp
  8022bd:	85 c0                	test   %eax,%eax
  8022bf:	79 1e                	jns    8022df <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  8022c1:	83 f8 f9             	cmp    $0xfffffff9,%eax
  8022c4:	75 07                	jne    8022cd <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  8022c6:	e8 be e9 ff ff       	call   800c89 <sys_yield>
  8022cb:	eb e2                	jmp    8022af <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  8022cd:	50                   	push   %eax
  8022ce:	68 91 2b 80 00       	push   $0x802b91
  8022d3:	6a 3b                	push   $0x3b
  8022d5:	68 a5 2b 80 00       	push   $0x802ba5
  8022da:	e8 cb de ff ff       	call   8001aa <_panic>
	}
}
  8022df:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8022e2:	5b                   	pop    %ebx
  8022e3:	5e                   	pop    %esi
  8022e4:	5f                   	pop    %edi
  8022e5:	5d                   	pop    %ebp
  8022e6:	c3                   	ret    

008022e7 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  8022e7:	f3 0f 1e fb          	endbr32 
  8022eb:	55                   	push   %ebp
  8022ec:	89 e5                	mov    %esp,%ebp
  8022ee:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  8022f1:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  8022f6:	6b d0 7c             	imul   $0x7c,%eax,%edx
  8022f9:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  8022ff:	8b 52 50             	mov    0x50(%edx),%edx
  802302:	39 ca                	cmp    %ecx,%edx
  802304:	74 11                	je     802317 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  802306:	83 c0 01             	add    $0x1,%eax
  802309:	3d 00 04 00 00       	cmp    $0x400,%eax
  80230e:	75 e6                	jne    8022f6 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  802310:	b8 00 00 00 00       	mov    $0x0,%eax
  802315:	eb 0b                	jmp    802322 <ipc_find_env+0x3b>
			return envs[i].env_id;
  802317:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80231a:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  80231f:	8b 40 48             	mov    0x48(%eax),%eax
}
  802322:	5d                   	pop    %ebp
  802323:	c3                   	ret    

00802324 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  802324:	f3 0f 1e fb          	endbr32 
  802328:	55                   	push   %ebp
  802329:	89 e5                	mov    %esp,%ebp
  80232b:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  80232e:	89 c2                	mov    %eax,%edx
  802330:	c1 ea 16             	shr    $0x16,%edx
  802333:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  80233a:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  80233f:	f6 c1 01             	test   $0x1,%cl
  802342:	74 1c                	je     802360 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  802344:	c1 e8 0c             	shr    $0xc,%eax
  802347:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  80234e:	a8 01                	test   $0x1,%al
  802350:	74 0e                	je     802360 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  802352:	c1 e8 0c             	shr    $0xc,%eax
  802355:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  80235c:	ef 
  80235d:	0f b7 d2             	movzwl %dx,%edx
}
  802360:	89 d0                	mov    %edx,%eax
  802362:	5d                   	pop    %ebp
  802363:	c3                   	ret    
  802364:	66 90                	xchg   %ax,%ax
  802366:	66 90                	xchg   %ax,%ax
  802368:	66 90                	xchg   %ax,%ax
  80236a:	66 90                	xchg   %ax,%ax
  80236c:	66 90                	xchg   %ax,%ax
  80236e:	66 90                	xchg   %ax,%ax

00802370 <__udivdi3>:
  802370:	f3 0f 1e fb          	endbr32 
  802374:	55                   	push   %ebp
  802375:	57                   	push   %edi
  802376:	56                   	push   %esi
  802377:	53                   	push   %ebx
  802378:	83 ec 1c             	sub    $0x1c,%esp
  80237b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  80237f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  802383:	8b 74 24 34          	mov    0x34(%esp),%esi
  802387:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  80238b:	85 d2                	test   %edx,%edx
  80238d:	75 19                	jne    8023a8 <__udivdi3+0x38>
  80238f:	39 f3                	cmp    %esi,%ebx
  802391:	76 4d                	jbe    8023e0 <__udivdi3+0x70>
  802393:	31 ff                	xor    %edi,%edi
  802395:	89 e8                	mov    %ebp,%eax
  802397:	89 f2                	mov    %esi,%edx
  802399:	f7 f3                	div    %ebx
  80239b:	89 fa                	mov    %edi,%edx
  80239d:	83 c4 1c             	add    $0x1c,%esp
  8023a0:	5b                   	pop    %ebx
  8023a1:	5e                   	pop    %esi
  8023a2:	5f                   	pop    %edi
  8023a3:	5d                   	pop    %ebp
  8023a4:	c3                   	ret    
  8023a5:	8d 76 00             	lea    0x0(%esi),%esi
  8023a8:	39 f2                	cmp    %esi,%edx
  8023aa:	76 14                	jbe    8023c0 <__udivdi3+0x50>
  8023ac:	31 ff                	xor    %edi,%edi
  8023ae:	31 c0                	xor    %eax,%eax
  8023b0:	89 fa                	mov    %edi,%edx
  8023b2:	83 c4 1c             	add    $0x1c,%esp
  8023b5:	5b                   	pop    %ebx
  8023b6:	5e                   	pop    %esi
  8023b7:	5f                   	pop    %edi
  8023b8:	5d                   	pop    %ebp
  8023b9:	c3                   	ret    
  8023ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8023c0:	0f bd fa             	bsr    %edx,%edi
  8023c3:	83 f7 1f             	xor    $0x1f,%edi
  8023c6:	75 48                	jne    802410 <__udivdi3+0xa0>
  8023c8:	39 f2                	cmp    %esi,%edx
  8023ca:	72 06                	jb     8023d2 <__udivdi3+0x62>
  8023cc:	31 c0                	xor    %eax,%eax
  8023ce:	39 eb                	cmp    %ebp,%ebx
  8023d0:	77 de                	ja     8023b0 <__udivdi3+0x40>
  8023d2:	b8 01 00 00 00       	mov    $0x1,%eax
  8023d7:	eb d7                	jmp    8023b0 <__udivdi3+0x40>
  8023d9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8023e0:	89 d9                	mov    %ebx,%ecx
  8023e2:	85 db                	test   %ebx,%ebx
  8023e4:	75 0b                	jne    8023f1 <__udivdi3+0x81>
  8023e6:	b8 01 00 00 00       	mov    $0x1,%eax
  8023eb:	31 d2                	xor    %edx,%edx
  8023ed:	f7 f3                	div    %ebx
  8023ef:	89 c1                	mov    %eax,%ecx
  8023f1:	31 d2                	xor    %edx,%edx
  8023f3:	89 f0                	mov    %esi,%eax
  8023f5:	f7 f1                	div    %ecx
  8023f7:	89 c6                	mov    %eax,%esi
  8023f9:	89 e8                	mov    %ebp,%eax
  8023fb:	89 f7                	mov    %esi,%edi
  8023fd:	f7 f1                	div    %ecx
  8023ff:	89 fa                	mov    %edi,%edx
  802401:	83 c4 1c             	add    $0x1c,%esp
  802404:	5b                   	pop    %ebx
  802405:	5e                   	pop    %esi
  802406:	5f                   	pop    %edi
  802407:	5d                   	pop    %ebp
  802408:	c3                   	ret    
  802409:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802410:	89 f9                	mov    %edi,%ecx
  802412:	b8 20 00 00 00       	mov    $0x20,%eax
  802417:	29 f8                	sub    %edi,%eax
  802419:	d3 e2                	shl    %cl,%edx
  80241b:	89 54 24 08          	mov    %edx,0x8(%esp)
  80241f:	89 c1                	mov    %eax,%ecx
  802421:	89 da                	mov    %ebx,%edx
  802423:	d3 ea                	shr    %cl,%edx
  802425:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802429:	09 d1                	or     %edx,%ecx
  80242b:	89 f2                	mov    %esi,%edx
  80242d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802431:	89 f9                	mov    %edi,%ecx
  802433:	d3 e3                	shl    %cl,%ebx
  802435:	89 c1                	mov    %eax,%ecx
  802437:	d3 ea                	shr    %cl,%edx
  802439:	89 f9                	mov    %edi,%ecx
  80243b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  80243f:	89 eb                	mov    %ebp,%ebx
  802441:	d3 e6                	shl    %cl,%esi
  802443:	89 c1                	mov    %eax,%ecx
  802445:	d3 eb                	shr    %cl,%ebx
  802447:	09 de                	or     %ebx,%esi
  802449:	89 f0                	mov    %esi,%eax
  80244b:	f7 74 24 08          	divl   0x8(%esp)
  80244f:	89 d6                	mov    %edx,%esi
  802451:	89 c3                	mov    %eax,%ebx
  802453:	f7 64 24 0c          	mull   0xc(%esp)
  802457:	39 d6                	cmp    %edx,%esi
  802459:	72 15                	jb     802470 <__udivdi3+0x100>
  80245b:	89 f9                	mov    %edi,%ecx
  80245d:	d3 e5                	shl    %cl,%ebp
  80245f:	39 c5                	cmp    %eax,%ebp
  802461:	73 04                	jae    802467 <__udivdi3+0xf7>
  802463:	39 d6                	cmp    %edx,%esi
  802465:	74 09                	je     802470 <__udivdi3+0x100>
  802467:	89 d8                	mov    %ebx,%eax
  802469:	31 ff                	xor    %edi,%edi
  80246b:	e9 40 ff ff ff       	jmp    8023b0 <__udivdi3+0x40>
  802470:	8d 43 ff             	lea    -0x1(%ebx),%eax
  802473:	31 ff                	xor    %edi,%edi
  802475:	e9 36 ff ff ff       	jmp    8023b0 <__udivdi3+0x40>
  80247a:	66 90                	xchg   %ax,%ax
  80247c:	66 90                	xchg   %ax,%ax
  80247e:	66 90                	xchg   %ax,%ax

00802480 <__umoddi3>:
  802480:	f3 0f 1e fb          	endbr32 
  802484:	55                   	push   %ebp
  802485:	57                   	push   %edi
  802486:	56                   	push   %esi
  802487:	53                   	push   %ebx
  802488:	83 ec 1c             	sub    $0x1c,%esp
  80248b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  80248f:	8b 74 24 30          	mov    0x30(%esp),%esi
  802493:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  802497:	8b 7c 24 38          	mov    0x38(%esp),%edi
  80249b:	85 c0                	test   %eax,%eax
  80249d:	75 19                	jne    8024b8 <__umoddi3+0x38>
  80249f:	39 df                	cmp    %ebx,%edi
  8024a1:	76 5d                	jbe    802500 <__umoddi3+0x80>
  8024a3:	89 f0                	mov    %esi,%eax
  8024a5:	89 da                	mov    %ebx,%edx
  8024a7:	f7 f7                	div    %edi
  8024a9:	89 d0                	mov    %edx,%eax
  8024ab:	31 d2                	xor    %edx,%edx
  8024ad:	83 c4 1c             	add    $0x1c,%esp
  8024b0:	5b                   	pop    %ebx
  8024b1:	5e                   	pop    %esi
  8024b2:	5f                   	pop    %edi
  8024b3:	5d                   	pop    %ebp
  8024b4:	c3                   	ret    
  8024b5:	8d 76 00             	lea    0x0(%esi),%esi
  8024b8:	89 f2                	mov    %esi,%edx
  8024ba:	39 d8                	cmp    %ebx,%eax
  8024bc:	76 12                	jbe    8024d0 <__umoddi3+0x50>
  8024be:	89 f0                	mov    %esi,%eax
  8024c0:	89 da                	mov    %ebx,%edx
  8024c2:	83 c4 1c             	add    $0x1c,%esp
  8024c5:	5b                   	pop    %ebx
  8024c6:	5e                   	pop    %esi
  8024c7:	5f                   	pop    %edi
  8024c8:	5d                   	pop    %ebp
  8024c9:	c3                   	ret    
  8024ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8024d0:	0f bd e8             	bsr    %eax,%ebp
  8024d3:	83 f5 1f             	xor    $0x1f,%ebp
  8024d6:	75 50                	jne    802528 <__umoddi3+0xa8>
  8024d8:	39 d8                	cmp    %ebx,%eax
  8024da:	0f 82 e0 00 00 00    	jb     8025c0 <__umoddi3+0x140>
  8024e0:	89 d9                	mov    %ebx,%ecx
  8024e2:	39 f7                	cmp    %esi,%edi
  8024e4:	0f 86 d6 00 00 00    	jbe    8025c0 <__umoddi3+0x140>
  8024ea:	89 d0                	mov    %edx,%eax
  8024ec:	89 ca                	mov    %ecx,%edx
  8024ee:	83 c4 1c             	add    $0x1c,%esp
  8024f1:	5b                   	pop    %ebx
  8024f2:	5e                   	pop    %esi
  8024f3:	5f                   	pop    %edi
  8024f4:	5d                   	pop    %ebp
  8024f5:	c3                   	ret    
  8024f6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8024fd:	8d 76 00             	lea    0x0(%esi),%esi
  802500:	89 fd                	mov    %edi,%ebp
  802502:	85 ff                	test   %edi,%edi
  802504:	75 0b                	jne    802511 <__umoddi3+0x91>
  802506:	b8 01 00 00 00       	mov    $0x1,%eax
  80250b:	31 d2                	xor    %edx,%edx
  80250d:	f7 f7                	div    %edi
  80250f:	89 c5                	mov    %eax,%ebp
  802511:	89 d8                	mov    %ebx,%eax
  802513:	31 d2                	xor    %edx,%edx
  802515:	f7 f5                	div    %ebp
  802517:	89 f0                	mov    %esi,%eax
  802519:	f7 f5                	div    %ebp
  80251b:	89 d0                	mov    %edx,%eax
  80251d:	31 d2                	xor    %edx,%edx
  80251f:	eb 8c                	jmp    8024ad <__umoddi3+0x2d>
  802521:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802528:	89 e9                	mov    %ebp,%ecx
  80252a:	ba 20 00 00 00       	mov    $0x20,%edx
  80252f:	29 ea                	sub    %ebp,%edx
  802531:	d3 e0                	shl    %cl,%eax
  802533:	89 44 24 08          	mov    %eax,0x8(%esp)
  802537:	89 d1                	mov    %edx,%ecx
  802539:	89 f8                	mov    %edi,%eax
  80253b:	d3 e8                	shr    %cl,%eax
  80253d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802541:	89 54 24 04          	mov    %edx,0x4(%esp)
  802545:	8b 54 24 04          	mov    0x4(%esp),%edx
  802549:	09 c1                	or     %eax,%ecx
  80254b:	89 d8                	mov    %ebx,%eax
  80254d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802551:	89 e9                	mov    %ebp,%ecx
  802553:	d3 e7                	shl    %cl,%edi
  802555:	89 d1                	mov    %edx,%ecx
  802557:	d3 e8                	shr    %cl,%eax
  802559:	89 e9                	mov    %ebp,%ecx
  80255b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  80255f:	d3 e3                	shl    %cl,%ebx
  802561:	89 c7                	mov    %eax,%edi
  802563:	89 d1                	mov    %edx,%ecx
  802565:	89 f0                	mov    %esi,%eax
  802567:	d3 e8                	shr    %cl,%eax
  802569:	89 e9                	mov    %ebp,%ecx
  80256b:	89 fa                	mov    %edi,%edx
  80256d:	d3 e6                	shl    %cl,%esi
  80256f:	09 d8                	or     %ebx,%eax
  802571:	f7 74 24 08          	divl   0x8(%esp)
  802575:	89 d1                	mov    %edx,%ecx
  802577:	89 f3                	mov    %esi,%ebx
  802579:	f7 64 24 0c          	mull   0xc(%esp)
  80257d:	89 c6                	mov    %eax,%esi
  80257f:	89 d7                	mov    %edx,%edi
  802581:	39 d1                	cmp    %edx,%ecx
  802583:	72 06                	jb     80258b <__umoddi3+0x10b>
  802585:	75 10                	jne    802597 <__umoddi3+0x117>
  802587:	39 c3                	cmp    %eax,%ebx
  802589:	73 0c                	jae    802597 <__umoddi3+0x117>
  80258b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  80258f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  802593:	89 d7                	mov    %edx,%edi
  802595:	89 c6                	mov    %eax,%esi
  802597:	89 ca                	mov    %ecx,%edx
  802599:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  80259e:	29 f3                	sub    %esi,%ebx
  8025a0:	19 fa                	sbb    %edi,%edx
  8025a2:	89 d0                	mov    %edx,%eax
  8025a4:	d3 e0                	shl    %cl,%eax
  8025a6:	89 e9                	mov    %ebp,%ecx
  8025a8:	d3 eb                	shr    %cl,%ebx
  8025aa:	d3 ea                	shr    %cl,%edx
  8025ac:	09 d8                	or     %ebx,%eax
  8025ae:	83 c4 1c             	add    $0x1c,%esp
  8025b1:	5b                   	pop    %ebx
  8025b2:	5e                   	pop    %esi
  8025b3:	5f                   	pop    %edi
  8025b4:	5d                   	pop    %ebp
  8025b5:	c3                   	ret    
  8025b6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8025bd:	8d 76 00             	lea    0x0(%esi),%esi
  8025c0:	29 fe                	sub    %edi,%esi
  8025c2:	19 c3                	sbb    %eax,%ebx
  8025c4:	89 f2                	mov    %esi,%edx
  8025c6:	89 d9                	mov    %ebx,%ecx
  8025c8:	e9 1d ff ff ff       	jmp    8024ea <__umoddi3+0x6a>
